what does **kw mean?
zslevi@gmail.com
levilista at gmail.com
Fri Jan 11 04:38:05 EST 2008
I've been reading the following example, and couldn't figure out, what
**kw mean. (It's an empty dictionary, but what's the semantics):
def wrap(method):
def wrapped(self, *args, **kw):
print "begin"
method(self, *args, **kw)
print "end"
return wrapped
class Test(object):
def method(self, name):
print "method(%r)" % name
t = Test()
t.method("pure")
Test.method = wrap(Test.method)
t.method("wrapped")
More information about the Python-list
mailing list