summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-24 19:05:29 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-24 19:05:29 (GMT)
commit5a05364049a7b0c3eeee94fb7b77e6b41036b3ae (patch)
tree81c455f0e6117e62fdaa6df0da46aece07267095 /Lib/decimal.py
parent71dba4ccee4d90c7dfb970ab77fcba113c9aec5c (diff)
downloadcpython-5a05364049a7b0c3eeee94fb7b77e6b41036b3ae.zip
cpython-5a05364049a7b0c3eeee94fb7b77e6b41036b3ae.tar.gz
cpython-5a05364049a7b0c3eeee94fb7b77e6b41036b3ae.tar.bz2
Add support for trunc().
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index e624a6d..eea9448 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -1433,6 +1433,8 @@ class Decimal(object):
else:
return s*int(self._int[:self._exp] or '0')
+ __trunc__ = __int__
+
def __long__(self):
"""Converts to a long.