mirror of
https://github.com/python/cpython.git
synced 2025-07-31 23:23:11 +00:00
mention from_float() in error message
This commit is contained in:
parent
a43f34cc2a
commit
a617e208fc
1 changed files with 2 additions and 2 deletions
|
@ -648,8 +648,8 @@ class Decimal(object):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
if isinstance(value, float):
|
if isinstance(value, float):
|
||||||
raise TypeError("Cannot convert float to Decimal. " +
|
raise TypeError("Cannot convert float in Decimal constructor. "
|
||||||
"First convert the float to a string")
|
"Use from_float class method.")
|
||||||
|
|
||||||
raise TypeError("Cannot convert %r to Decimal" % value)
|
raise TypeError("Cannot convert %r to Decimal" % value)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue