[Python-ideas] Printf function?

Carl M. Johnson cmjohnson.mailinglist at gmail.com
Sun May 13 05:37:54 CEST 2012


On May 12, 2012, at 3:50 PM, Cameron Simpson wrote:

> Observe my Python 3.2:
> 
>  [/home/cameron]janus*> python3.2
>  Python 3.2.2 (default, May  2 2012, 09:04:59) 
>  [GCC 4.5.3] on linux2
>  Type "help", "copyright", "credits" or "license" for more information.
>>>> x=1.5
>>>> print("%10.2f" % x)
>        1.50
>>>> 
> 
> Printf isn't needed.

Well, if that's the solution, why do we even have .format in the first place? I know there are a lot of people who still prefer % formatting, but I personally never liked it, and I prefer not to use it if I have any choice about it. But that's neither here nor there. My question is, being that we have .format, why not make it easier to use?


More information about the Python-ideas mailing list