Kaydet (Commit) abf8a56e authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Don't use mutable values for method defaults.

üst f3958f16
...@@ -2161,11 +2161,15 @@ class Context(object): ...@@ -2161,11 +2161,15 @@ class Context(object):
""" """
def __init__(self, prec=None, rounding=None, def __init__(self, prec=None, rounding=None,
traps=None, flags=[], traps=None, flags=None,
_rounding_decision=None, _rounding_decision=None,
Emin=None, Emax=None, Emin=None, Emax=None,
capitals=None, _clamp=0, 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): if not isinstance(flags, dict):
flags = dict([(s,s in flags) for s in _signals]) flags = dict([(s,s in flags) for s in _signals])
del s del s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment