[Python-checkins] r77739 - python/trunk/Lib/decimal.py

benjamin.peterson python-checkins at python.org
Mon Jan 25 04:52:52 CET 2010


Author: benjamin.peterson
Date: Mon Jan 25 04:52:52 2010
New Revision: 77739

Log:
mention from_float() in error message

Modified:
   python/trunk/Lib/decimal.py

Modified: python/trunk/Lib/decimal.py
==============================================================================
--- python/trunk/Lib/decimal.py	(original)
+++ python/trunk/Lib/decimal.py	Mon Jan 25 04:52:52 2010
@@ -648,8 +648,8 @@
             return self
 
         if isinstance(value, float):
-            raise TypeError("Cannot convert float to Decimal.  " +
-                            "First convert the float to a string")
+            raise TypeError("Cannot convert float in Decimal constructor. "
+                            "Use from_float class method.")
 
         raise TypeError("Cannot convert %r to Decimal" % value)
 


More information about the Python-checkins mailing list