[issue11680] decimal module generates AttributeError: on call to as_integer_ratio

2011-03-26 Thread Mark Dickinson
Mark Dickinson added the comment: 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 i

[issue11680] decimal module generates AttributeError: on call to as_integer_ratio

2011-03-26 Thread Daniel Urban
Daniel Urban added the comment: The problem seems to be that you're calling Decimal.from_float with a Decimal instance, not a float. I'm not sure that should even work. The Decimal constructor can create a decimal from an other decimal. Your suggested solution probably would solve this exce

[issue11680] decimal module generates AttributeError: on call to as_integer_ratio

2011-03-25 Thread David Bailey
New submission from David Bailey : File "C:\test3.py", line 166, in m self.from_float(value * decimal.Decimal(1.0))/decimal.Decimal(1.0) File "c:\Python27\lib\decimal.py", line 691, in from_float n, d = abs(f).as_integer_ratio() AttributeError: 'Decimal' object has no attribute 'as_inte