diff options
author | louiz’ <louiz@louiz.org> | 2016-07-06 10:08:23 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-07-06 10:08:23 +0200 |
commit | 3dcb04992dd6eb3f76f9d449ae7118da2c572d08 (patch) | |
tree | 5d443bc045865da04329e18c31c8a2dac14b30a2 | |
parent | 96a9fb699fbdb7c71d7633b6afdec3bb7ea885b9 (diff) | |
download | poezio-3dcb04992dd6eb3f76f9d449ae7118da2c572d08.tar.gz poezio-3dcb04992dd6eb3f76f9d449ae7118da2c572d08.tar.bz2 poezio-3dcb04992dd6eb3f76f9d449ae7118da2c572d08.tar.xz poezio-3dcb04992dd6eb3f76f9d449ae7118da2c572d08.zip |
Don't use a list (that we modify) as a default argument
-rw-r--r-- | poezio/decorators.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/poezio/decorators.py b/poezio/decorators.py index 344fe9ac..4891d5a5 100644 --- a/poezio/decorators.py +++ b/poezio/decorators.py @@ -68,7 +68,7 @@ class CommandArgParser(object): return wrap @staticmethod - def quoted(mandatory, optional=0, defaults=[], + def quoted(mandatory, optional=0, defaults=None, ignore_trailing_arguments=False): """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'] """ + if defaults is None: + defaults = [] def first(func): def second(self, args, *a, **kw): default_args = defaults |