[Python-ideas] Python Numbers as Human Concept Decimal System
Andrew Barnert
abarnert at yahoo.com
Sat Mar 8 07:18:53 CET 2014
From: Steven D'Aprano <steve at pearwood.info>
Sent: Friday, March 7, 2014 10:08 PM
> On Fri, Mar 07, 2014 at 09:40:47PM -0800, Mark H. Harris wrote:
>
>> hi Andrew, I have been studying the python-ideas archive & the
>> python-dev archive all night. I have read hundreds of posts. I am
>> finding something very interesting. My proposal has been coming up
>> (time and again) in different flavors for many years; with all the
>> same people participating (with all of the very same discussion almost
>> verbatim).
>
> Which proposal? You have made a few, and I cannot keep track of which
> ones you still stand by and which ones you have abandoned.
I agree that some clarity would be nice here, but I think from the quote he quoted it's pretty clear that he's talking about the decimal-literal proposal, not any of the ones that you mentioned.
> - that Python unify all numeric types to one "Python
> Number" (I think this is abandoned)
>
> - that Decimal(float) use AI to determine what number the programmer
> wanted (you've agreed to stop using the term "AI", but I'm not
> entirely
> sure whether you've moved away from this position entirely -- you
> still describe Python as needing to "intelligently" convert floats)
I'm still not sure exactly what Mark's proposal is here, but Guido has developed this one into something concrete and feasible: change the default conversion from float to Decimal (that is, Decimal(float)) to use the repr. I don't want to put works in Mark's mouth and say that's what he's interested in here, but I can say that it looks like it would solve the problem cases Mark has brought up.
> - that allowing Decimal(float) at all is a mistake and should be
> prohibited
>
> - that the default numeric type when the programmer enters a numeral
> with a decimal point like 2.01 be Decimal
More information about the Python-ideas
mailing list