Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c3f503

Browse files
committed
Issue #13701: Fix decorator avoidance (due to desire for Python 2.3 compatibility) in decimal module.
1 parent a28cf6f commit 9c3f503

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Lib/decimal.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,7 @@ def __new__(cls, value="0", context=None):
703703

704704
raise TypeError("Cannot convert %r to Decimal" % value)
705705

706-
# @classmethod, but @decorator is not valid Python 2.3 syntax, so
707-
# don't use it (see notes on Py2.3 compatibility at top of file)
706+
@classmethod
708707
def from_float(cls, f):
709708
"""Converts a float to a decimal number, exactly.
710709
@@ -743,7 +742,6 @@ def from_float(cls, f):
743742
return result
744743
else:
745744
return cls(result)
746-
from_float = classmethod(from_float)
747745

748746
def _isnan(self):
749747
"""Returns whether the number is not actually one.

0 commit comments

Comments
 (0)