We see in the "Quick-Start Tutorial" (py3k section 8.4.1) the following example: >>> Decimal(3.14) Decimal('3.140000000000000124344978758017532527446746826171875') In actua; fact one would expect an exception from that code, which should perhaps instead read >>> Decimal.from_float(3.14) Decimal('3.140000000000000124344978758017532527446746826171875') This class method is the recommended way to convert floats to decimal when necessary.
Behavior for mixed operations varies greatly between Python versions. The first table over here lists the differences and should be valid for decimal.py: http://www.bytereef.org/mpdecimal/doc/cdecimal/index.html#floatoperation-signal As an extension, cdecimal has the FloatOperation signal, which enforces stricter semantics. The second table on that page lists the behavior if the signal is enabled.
The example is correct and runs as expected: >>> Decimal(3.14) Decimal('3.140000000000000124344978758017532527446746826171875') Per the Whatsnew3.2 document: ''' The decimal.Decimal constructor now accepts float objects directly so there in no longer a need to use the from_float() method (issue 8257). '''