[Python-3000] PEP 3101 clarification requests

Guido van Rossum guido at python.org
Tue Aug 21 03:03:09 CEST 2007


On 8/20/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Eric Smith wrote:
> > Guido van Rossum wrote:
> >
> > > Why? The conversion code can just generate !s:-20 instead of :-20s.
> >
> > Talin:  On your list of to-do items for the PEP, could you add that the
> > only conversions for the standard conversion specifiers are int <-> float?
>
> Please, no! While the converter may be able to handle
> it, "!s:-20" is terribly ugly for humans.

But how often will you need this? (You only need the !s part if you
don't know that the argument is a string.) The alternative would
require every type's formatter to interpret -20s the same way, which
goes against the idea that the conversion mini-language is an object's
own business.

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


More information about the Python-3000 mailing list