Python Decimal doesn\'t support being constructed from float; it expects that you have to convert float to a string first.
This is very inconvenient since standard
The "right" way to do this was documented in 1990 by Steele and White's and Clinger's PLDI 1990 papers.
You might also look at this SO discussion about Python Decimal, including my suggestion to try using something like frap to rationalize a float.