mirror of
https://github.com/python/cpython.git
synced 2025-09-20 15:40:32 +00:00
Don't use mutable values for method defaults.
This commit is contained in:
parent
f3958f16cf
commit
abf8a56e68
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue