mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #13701: Fix decorator avoidance (due to desire for Python 2.3 compatibility) in decimal module.
This commit is contained in:
parent
a28cf6fef9
commit
9c3f5031a9
1 changed files with 1 additions and 3 deletions
|
@ -703,8 +703,7 @@ class Decimal(object):
|
||||||
|
|
||||||
raise TypeError("Cannot convert %r to Decimal" % value)
|
raise TypeError("Cannot convert %r to Decimal" % value)
|
||||||
|
|
||||||
# @classmethod, but @decorator is not valid Python 2.3 syntax, so
|
@classmethod
|
||||||
# don't use it (see notes on Py2.3 compatibility at top of file)
|
|
||||||
def from_float(cls, f):
|
def from_float(cls, f):
|
||||||
"""Converts a float to a decimal number, exactly.
|
"""Converts a float to a decimal number, exactly.
|
||||||
|
|
||||||
|
@ -743,7 +742,6 @@ class Decimal(object):
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
return cls(result)
|
return cls(result)
|
||||||
from_float = classmethod(from_float)
|
|
||||||
|
|
||||||
def _isnan(self):
|
def _isnan(self):
|
||||||
"""Returns whether the number is not actually one.
|
"""Returns whether the number is not actually one.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue