diff options
author | Christian Heimes <christian@cheimes.de> | 2008-02-12 22:59:25 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-02-12 22:59:25 (GMT) |
commit | 0bd4e11887bb9ffbde38f94468cc5b317f96b815 (patch) | |
tree | 8a8268e4fba191f7fc435d633cbd1edbf8808fe7 /Lib/decimal.py | |
parent | 4718bf894103887262287293599f4188e2601d37 (diff) | |
download | cpython-0bd4e11887bb9ffbde38f94468cc5b317f96b815.zip cpython-0bd4e11887bb9ffbde38f94468cc5b317f96b815.tar.gz cpython-0bd4e11887bb9ffbde38f94468cc5b317f96b815.tar.bz2 |
Merged revisions 60481,60485,60489-60492,60494-60496,60498-60499,60501-60503,60505-60506,60508-60509,60523-60524,60532,60543,60545,60547-60548,60552,60554,60556-60559,60561-60562,60569,60571-60572,60574,60576-60583,60585-60586,60589,60591,60594-60595,60597-60598,60600-60601,60606-60612,60615,60617,60619-60621,60623-60625,60627-60629,60631,60633,60635,60647,60650,60652,60654,60656,60658-60659,60664-60666,60668-60670,60672,60676,60678,60680-60683,60685-60686,60688,60690,60692-60694,60697-60700,60705-60706,60708,60711,60714,60720,60724-60730,60732,60735-60751 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r60735 | raymond.hettinger | 2008-02-11 23:53:01 +0100 (Mon, 11 Feb 2008) | 1 line
Add notes on how decimal fits into the model.
........
r60737 | raymond.hettinger | 2008-02-12 00:34:56 +0100 (Tue, 12 Feb 2008) | 1 line
Fix markup
........
r60738 | raymond.hettinger | 2008-02-12 00:38:00 +0100 (Tue, 12 Feb 2008) | 1 line
Backport ABC docs
........
r60739 | raymond.hettinger | 2008-02-12 01:15:32 +0100 (Tue, 12 Feb 2008) | 1 line
Restore fractions.rst to the document tree.
........
r60740 | raymond.hettinger | 2008-02-12 01:48:20 +0100 (Tue, 12 Feb 2008) | 1 line
Fix typo in comments
........
r60741 | raymond.hettinger | 2008-02-12 02:18:03 +0100 (Tue, 12 Feb 2008) | 1 line
Bring decimal a bit closer to the spec for Reals.
........
r60743 | martin.v.loewis | 2008-02-12 14:47:26 +0100 (Tue, 12 Feb 2008) | 2 lines
Patch #1736: Fix file name handling of _msi.FCICreate.
........
r60745 | kurt.kaiser | 2008-02-12 16:45:50 +0100 (Tue, 12 Feb 2008) | 2 lines
what??! Correct r60225.
........
r60747 | martin.v.loewis | 2008-02-12 19:47:34 +0100 (Tue, 12 Feb 2008) | 4 lines
Patch #1966: Break infinite loop in httplib when the servers
implements the chunked encoding incorrectly.
Will backport to 2.5.
........
r60749 | raymond.hettinger | 2008-02-12 20:05:36 +0100 (Tue, 12 Feb 2008) | 1 line
dict.copy() rises from the ashes. Revert r60687.
........
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 873f7c0..2745065 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -1518,6 +1518,20 @@ class Decimal(_numbers.Real, _numbers.Inexact): __trunc__ = __int__ + @property + def real(self): + return self + + @property + def imag(self): + return Decimal(0) + + def conjugate(self): + return self + + def __complex__(self): + return complex(float(self)) + def _fix_nan(self, context): """Decapitate the payload of a NaN to fit the context""" payload = self._int |