ALL function arguments in a common dictionary

Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de
Wed Apr 24 09:36:48 EDT 2013


Hi everybody,
what is the recommended way of stuffing *all* function arguments (not just
the ones passed by **kwargs) into a common dictionary?

The following sort of works when used as the first block in a function:
try:
    kwargs.update(locals())
except NameError:
    kwargs = locals().copy()

except that it's nesting pre-existing kwargs.

Thanks for your help,
Wolfgang




More information about the Python-list mailing list