[Python-Dev] converting the stdlib to str.format (original) (raw)

Guido van Rossum guido at python.org
Fri Jun 6 17:52:26 CEST 2008


+1

On 6/6/08, Steve Holden <steve at holdenweb.com> wrote: > Nick Coghlan wrote: >> Greg Ewing wrote: >>> Nick Coghlan wrote: >>>>>>> - remove support for passing a single value to a format string >>>> without wrapping it in an iterable first >>>>>> But won't that clobber a large number of the simple >>> use cases that you want to keep %-formatting for? >>>> Note the part of the proposal that allows any iterable on the right >> hand side rather than the current insistence on a tuple. So the >> single-value use cases can be boxed easily with a list. >>>> To my mind salvaging %-formatting requires removing the ambiguity over >> whether or not the right hand side will be iterated over. >>> But then this breaks code where iterables are intended to be output > using a single %s format specifier, for example. I don't see why this > would be regarded as helpful. To avoid breakage I'd rather keep the > %-formatting ability as it is, and label it a legacy feature, rather > than "salvaging" it. It's going to be too tricky to convert using 2to3 > otherwise. >> regards > Steve > -- > Steve Holden +1 571 484 6266 +1 800 494 3119 > Holden Web LLC http://www.holdenweb.com/ >> _________________________ > Python-Dev mailing list > Python-Dev at python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > http://mail.python.org/mailman/options/python-dev/guido%40python.org >

Sent from Gmail for mobile | mobile.google.com

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list