This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients mark.dickinson, rhettinger, steven.daprano
Date 2009-01-02.17:08:24
SpamBayes Score 3.53816e-05
Marked as misclassified No
Message-id <1230916106.3.0.455479805252.issue4796@psf.upfronthosting.co.za>
In-reply-to
Content
Mark wrote:
>> Also, why not just extend the Decimal() constructor to accept
>> a float as the argument? Why have a separate from_float() 
>> method at all?
>
> This was discussed extensively when the decimal module was 
> being proposed;  see the Decimal PEP for arguments against this.

I'm very aware of that. The Decimal PEP says the consensus was for 
from_float() to take a second argument specifying the precision. 
Decimal(1.1) => Decimal("1.1") was rejected for the reasons given in 
the PEP by Paul Moore, and Decimal(1.1) => 
Decimal('110000000000000008881784197001252...e-51') was (presumably) 
rejected because it would confuse newbies. Hence the decision to (1) 
make an alternative constructor and (2) have it take a second 
argument.

It looks like you and Raymond have rejected #2 but are keeping #1, and 
I'm curious why. That's genuine curiosity, and a real question, not a 
thinly-veiled scowl of disapproval disguised as a question :)

Anyway, I'm happy enough so long as Raymond's suggested 
Context.create_decimal() exists, that's the actual functionality I'm 
after, so maybe I should let you guys get on with it. Thanks.
History
Date User Action Args
2009-01-02 17:08:26steven.dapranosetrecipients: + steven.daprano, rhettinger, mark.dickinson
2009-01-02 17:08:26steven.dapranosetmessageid: <1230916106.3.0.455479805252.issue4796@psf.upfronthosting.co.za>
2009-01-02 17:08:25steven.dapranolinkissue4796 messages
2009-01-02 17:08:25steven.dapranocreate