summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-10-12 09:12:16 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-10-12 09:12:16 (GMT)
commitabf8a56e68a38f5bcff1fa1aa3742ff35854dd45 (patch)
tree5b58df24ead80ee6b239002e4f9ae4f2174c7659 /Lib/decimal.py
parentf3958f16cf54c5ff1af791cbc0fe491ce2622c6d (diff)
downloadcpython-abf8a56e68a38f5bcff1fa1aa3742ff35854dd45.zip
cpython-abf8a56e68a38f5bcff1fa1aa3742ff35854dd45.tar.gz
cpython-abf8a56e68a38f5bcff1fa1aa3742ff35854dd45.tar.bz2
Don't use mutable values for method defaults.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 0df046d..e4c3344 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -2161,11 +2161,15 @@ class Context(object):
"""
def __init__(self, prec=None, rounding=None,
- traps=None, flags=[],
+ traps=None, flags=None,
_rounding_decision=None,
Emin=None, Emax=None,
capitals=None, _clamp=0,
- _ignored_flags=[]):
+ _ignored_flags=None):
+ if flags is None:
+ flags = []
+ if _ignored_flags is None:
+ _ignored_flags = []
if not isinstance(flags, dict):
flags = dict([(s,s in flags) for s in _signals])
del s