pop_arg: Rename "default" to "pop_arg_default"
Users of pop_arg() may wish to pop an argument which is itself named
"default". This would have caused a naming conflict.
Renaming pop_arg's "default" to "pop_arg_default" to accommodate.
Change-Id: I9b0bd31da2fdfe1adc0620b163a3eca54a52da18
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/func_args.py b/lib/func_args.py
index bc1bb7e..4edb5cd 100644
--- a/lib/func_args.py
+++ b/lib/func_args.py
@@ -8,7 +8,7 @@
import collections
-def pop_arg(default=None, *args, **kwargs):
+def pop_arg(pop_arg_default=None, *args, **kwargs):
r"""
Pop a named argument from the args/kwargs and return a tuple consisting of the argument value, the
modified args and the modified kwargs.
@@ -46,7 +46,7 @@
difference being that the last_name value was popped from kwargs rather than from args.
Description of argument(s):
- default The value to return if the named argument is not present in args/kwargs.
+ pop_arg_default The value to return if the named argument is not present in args/kwargs.
args The positional arguments passed to the calling function.
kwargs The keyword arguments passed to the calling function.
"""
@@ -61,7 +61,7 @@
if args:
arg_value = args.pop(0)
else:
- arg_value = default
+ arg_value = pop_arg_default
return arg_value, args, kwargs