guneysus
12/25/2014 - 1:00 PM

For *args and **kwargs Locals globals tricks

For *args and **kwargs Locals globals tricks

def foo(*args, **kwargs):
  locals().update(**kwargs)
  print locals()
      

In [54]: foo(a=10)
{'a': 10, 'args': (), 'kwargs': {'a': 10}}