diff options
| author | Raymond Hettinger <python@rcn.com> | 2004-10-12 09:12:16 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2004-10-12 09:12:16 +0000 |
| commit | 58ccb99e51919af2e4334bdd5aa5e9e5cde4a0db (patch) | |
| tree | 2a9218afb324b5f0bc7c21b8ba2da1619b65ec4d /Lib | |
| parent | 352b3b8d821b8c2bfac1073bbce69f4215aacf7b (diff) | |
| download | cpython-58ccb99e51919af2e4334bdd5aa5e9e5cde4a0db.tar.gz | |
Don't use mutable values for method defaults.
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/decimal.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 0df046dcb1..e4c33449b0 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 |
