[Python-3000] String formating operations in python 3k

John J Lee jjl at pobox.com
Wed Apr 5 21:15:57 CEST 2006


On Tue, 4 Apr 2006, Barry Warsaw wrote:
[...]
> Yes, I think this is where we differ.  $thing in it's most common
> form is more readable to me than {thing}, and while the former is
> equivalent to ${thing} with string.Template's defaults, I find it's
> very rarely used.

Regardless of readability, I think that very rarity, and the presence of 
two rules in place of Greg's single rule, is likely a problem for new 
users.  The ${} case becomes an odd little corner case you forget about, 
then bump into later.  If you're new to all this, you may not even have 
understood the need for it in the first place.

It's a relatively small problem, but certainly not a non-existant one. 
Exactly that sort of problem, piled high, is what makes Perl so hard to 
learn compared with Python.  Piled less high, it's still a real barrier.


> So I wouldn't be in favor of changing it.  Of
> course, beauty is in the eye of the beholder and all that...

Clarity and difficulty of learning, OTOH, may not be.  Those are questions 
that could perfectly well be objectively tested (though I doubt anybody 
has ever done so, or is likely to).


John


More information about the Python-3000 mailing list