[Python-ideas] %-formatting with Decimals

Ethan Furman ethan at stoneleaf.us
Tue Mar 11 21:25:00 CET 2014


On 03/11/2014 12:17 PM, random832 at fastmail.us wrote:
> On Tue, Mar 11, 2014, at 9:15, Serhiy Storchaka wrote:
>> 11.03.14 14:44, Oscar Benjamin написав(ла):
>>> Am I doing this wrong? Is this just a limitation of the old-style %
>>> formatting or something that could possibly be improved?
>>
>> Yes, this is a limitation of the old-style % formatting. Another example:
>
> 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.

>  Is it going to be deprecated?

No.  %-formatting has its place.

> Will a tool be provided to convert usages (at least with static format strings)
>  to str.format()?

No.  Feel free to write one and share it with the community.  :)

Basically, %-formatting is primitive, .format-formatting is advanced.  If you want advanced behavior, use the advanced 
method.

--
~Ethan~


More information about the Python-ideas mailing list