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 mark.dickinson
Recipients daniel.urban, daveabailey, mark.dickinson
Date 2011-03-26.09:06:40
SpamBayes Score 2.9403147e-09
Marked as misclassified No
Message-id <1301130401.67.0.984106764134.issue11680@psf.upfronthosting.co.za>
In-reply-to
Content
As Daniel says, from_float expects a float object, not a Decimal instance.

What did you want to achieve in the following line:

   self.from_float(value * decimal.Decimal(1.0))/decimal.Decimal(1.0)

?

By the way: in all current versions of Python, from_float is redundant:  you can create a Decimal directly from a float:


Python 2.7.1+ (2.7:d52b1faa7b11+, Mar 25 2011, 21:48:24) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from decimal import Decimal
[64140 refs]
>>> Decimal(2.3)
Decimal('2.29999999999999982236431605997495353221893310546875')
[64149 refs]
History
Date User Action Args
2011-03-26 09:06:41mark.dickinsonsetrecipients: + mark.dickinson, daniel.urban, daveabailey
2011-03-26 09:06:41mark.dickinsonsetmessageid: <1301130401.67.0.984106764134.issue11680@psf.upfronthosting.co.za>
2011-03-26 09:06:41mark.dickinsonlinkissue11680 messages
2011-03-26 09:06:41mark.dickinsoncreate