[Python-Dev] Re: Yet another string formatting proposal (original) (raw)

Chermside, Michael mchermside@ingdirect.com
Fri, 22 Nov 2002 09:00:30 -0500


[Oren proposes "(a) + (b)" string formatting.]

I've been watching the string formatting proposals for a while. Each time I've thought... "well, it seems a LITTLE nicer than %s and %(name)s, but is it really ENOUGH better that it's worth replacing what we've got?". So far I've generally been unsure.

But this one is good. It's best features are that it is simple, and elegant. I would prefer {} over () because it is more distinctive ("(" being used in REs), and somehow the=20 {} seem more consistent with "execution" and () with "grouping" across a broad range of languages.

I'm also bit dubious about the name "cook" (cute though!). But The design is clean and readable. The separation between cook() and cook_eval() is probably quite wise (although it will throw a couple of newbies, but in the process it'll teach them to beware of eval'ing arbitrary data).

+1 (but, of course, that vote doesn't count until there's a PEP to refer to).

-- Michael Chermside