[Python-ideas] Python Numbers as Human Concept Decimal System

Tim Peters tim.peters at gmail.com
Sat Mar 8 06:01:07 CET 2014


[Guido]
> I agree. But what do you think of my main proposal? I would retract it if
> you advised me so.

Oh, I stick to tiny detail these days, to avoid getting sucked into
endless pointless arguments ;-)

That said, I agree that the default Decimal constructor acting like
Decimal(x) == Decimal(repr(x)) would be far less surprising to the
vast majority of users, and no problem at all for "expert" users
(provided Decimal.from_float(x) were still available).

Against it, the change would invalidate dozens of stackoverflow
answers advising users to try printing Decimal(x) to see where their
naive binary floating-point expectations are going wrong.  And I have
no feel for how much production code may be relying on current
Decimal(x) behavior (I have none).

But, if we're willing to risk changing the meaning of
bool(datetime,time(arguments creating an object in some timezones -
but not all - that converts to midnight UTC )), then I suppose the
floodgates are waaaaaay open now ;-)


More information about the Python-ideas mailing list