changeset: 80108:7ada0faded9b user: Mark Dickinson date: Wed Oct 31 17:53:27 2012 +0000 files: Lib/decimal.py description: Issue #13701: Fix decorator avoidance (due to desire for Python 2.3 compatibility) in decimal module. diff -r f2e4b9870cfb -r 7ada0faded9b Lib/decimal.py --- a/Lib/decimal.py Wed Oct 31 13:36:21 2012 -0400 +++ b/Lib/decimal.py Wed Oct 31 17:53:27 2012 +0000 @@ -703,8 +703,7 @@ raise TypeError("Cannot convert %r to Decimal" % value) - # @classmethod, but @decorator is not valid Python 2.3 syntax, so - # don't use it (see notes on Py2.3 compatibility at top of file) + @classmethod def from_float(cls, f): """Converts a float to a decimal number, exactly. @@ -743,7 +742,6 @@ return result else: return cls(result) - from_float = classmethod(from_float) def _isnan(self): """Returns whether the number is not actually one.

AltStyle によって変換されたページ (->オリジナル) /