Commit 3dcb0499 authored by louiz’'s avatar louiz’

Don't use a list (that we modify) as a default argument

parent 96a9fb69
...@@ -68,7 +68,7 @@ class CommandArgParser(object): ...@@ -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): ...@@ -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
......
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