summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 4f23d33..dbe0695 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -1519,6 +1519,20 @@ class Decimal(object):
__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 __long__(self):
"""Converts to a long.