diff options
| author | Raymond Hettinger <python@rcn.com> | 2009-02-03 03:37:03 (GMT) |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2009-02-03 03:37:03 (GMT) |
| commit | 2c8585b0afb6a39c215a71963e2fadea96f2c6ae (patch) | |
| tree | bc63337a7f90f8e4914e013a1fcbf322e07f0b96 /Lib/decimal.py | |
| parent | 4a1b62a555a4f39412b5538a6d80ebd914015794 (diff) | |
| download | cpython-2c8585b0afb6a39c215a71963e2fadea96f2c6ae.zip cpython-2c8585b0afb6a39c215a71963e2fadea96f2c6ae.tar.gz cpython-2c8585b0afb6a39c215a71963e2fadea96f2c6ae.tar.bz2 | |
Register decimals as numbers.Number
Diffstat (limited to 'Lib/decimal.py')
| -rw-r--r-- | Lib/decimal.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 87bd142..dfc7043 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -136,6 +136,7 @@ __all__ = [ import copy as _copy import math as _math +import numbers as _numbers try: from collections import namedtuple as _namedtuple @@ -3608,6 +3609,12 @@ def _dec_from_triple(sign, coefficient, exponent, special=False): return self +# Register Decimal as a kind of Number (an abstract base class). +# However, do not register it as Real (because Decimals are not +# interoperable with floats). +_numbers.Number.register(Decimal) + + ##### Context class ####################################################### |
