Cheat sheet for the new string formatting?

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Jun 9 11:42:24 EDT 2015


On 09/06/2015 13:15, Skip Montanaro wrote:
>
> One thing which seems obvious now is that since format() delegates to
> the individual types for formatting, much of the documentation of this
> stuff must now be delegated to the individual types. However, I can't
> find anything about the formatting syntax supported by
> float.__format__.  Where might I find it documented that "{:.3}" is
> synonymous with "%.3g"?
>

You won't, at least not that I'm aware of.  I think part of the problem 
is that there was a lot of confusion as to whether or not the old style 
formatting was to be deprecated.  See http://bugs.python.org/issue14123 
which refers to http://www.gossamer-threads.com/lists/python/dev/969817

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list