Python 2.7 issue with decimal value 0.0

Larry Martell larry.martell at gmail.com
Wed Mar 25 10:20:41 EDT 2015


I have an app that works with 2.6, but in 2.7 it is failing. I traced
it down to an issue with decimal.Decimal being passed a value of 0.0.
It 2.6 this is fine, but in 2.7 it throws an exception:

TypeError: Cannot convert float to Decimal.  First convert the float to a string

This is easy enough to deal with, but I find it odd. Is this a known issue?



More information about the Python-list mailing list