Re: Yet another string formatting proposal
[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 {} 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
On Fri, Nov 22, 2002 at 09:00:30AM -0500, Chermside, Michael wrote:
But this one is good. It's best features are that it is _simple_, and _elegant_.
Thanks!
I would prefer \{} over \() because it is more distinctive ("\(" being used in REs), and somehow the {} seem more consistent with "execution" and () with "grouping" across a broad range of languages.
Yes, I'm starting to lean in the direction of \{}, too.
I'm also bit dubious about the name "cook" (cute though!).
The rationale behind the name wasn't just "cuteness". The effect of this method is the exact opposite of the "raw" prefix so the name "cook" was the most natural and descriptive choice. Got any other ideas?
+1 (but, of course, that vote doesn't count until there's a PEP to refer to).
Just wanted to sample the water first. I bet everyone is already sick of this subject after two PEPs, several other proposals, endless discussions and no results. Oren
participants (2)
-
Chermside, Michael
-
Oren Tirosh