Don't use a list (that we modify) as a default argument
This commit is contained in:
parent
96a9fb699f
commit
3dcb04992d
1 changed files with 3 additions and 1 deletions
|
@ -68,7 +68,7 @@ class CommandArgParser(object):
|
||||||
return wrap
|
return wrap
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def quoted(mandatory, optional=0, defaults=[],
|
def quoted(mandatory, optional=0, defaults=None,
|
||||||
ignore_trailing_arguments=False):
|
ignore_trailing_arguments=False):
|
||||||
|
|
||||||
"""The function receives a list with a number of arguments that is between
|
"""The function receives a list with a number of arguments that is between
|
||||||
|
@ -113,6 +113,8 @@ class CommandArgParser(object):
|
||||||
['un et demi', 'deux', 'trois quatre cinq six']
|
['un et demi', 'deux', 'trois quatre cinq six']
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if defaults is None:
|
||||||
|
defaults = []
|
||||||
def first(func):
|
def first(func):
|
||||||
def second(self, args, *a, **kw):
|
def second(self, args, *a, **kw):
|
||||||
default_args = defaults
|
default_args = defaults
|
||||||
|
|
Loading…
Reference in a new issue