[Python-ideas] %-formatting with Decimals

random832 at fastmail.us random832 at fastmail.us
Tue Mar 11 22:51:06 CET 2014


On Tue, Mar 11, 2014, at 16:25, Ethan Furman wrote:
> > Is % formatting not going to be updated to support new features
> 
> No.
>
> > or fix bugs like this?
> 
> It's not a bug.  Decimal is not float.

The bug to which I was referring involves not calling __format__ on
whatever object is passed in as str.format does - Decimal not being
float is no impediment to str.format and Decimal.__format__ accepting
the same format strings that float.__format__ does.

> >  Is it going to be deprecated?
> 
> No.  %-formatting has its place.

What place is that?

    There should be one-- and preferably only one --obvious way to do
    it.

We've got two syntaxes, and two functions, that do _almost_ the same
thing, but with two completely different microlanguages. Why?


More information about the Python-ideas mailing list