I wish all my problems involved just a couple of variables, but unfortunately the real interesting problems tend to be complex...
As a last resort this problem could be solved by something like this: def fun(**kw): a = 100 for k,v in kw.items(): exec('%s = %s'%(k,v)) print locals() >>> fun(**{'a':1,'b':2}) {'a': 1, 'k': 'b', 'b': 2, 'kw': {'a': 1, 'b': 2}, 'v': 2} But that would be utterly stupid! So much for not being able to write to locals().... any better Ideas? -- http://mail.python.org/mailman/listinfo/python-list