what does **kw mean?

zslevi@gmail.com levilista at gmail.com
Fri Jan 11 10:38:05 CET 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()
Test.method = wrap(Test.method)

More information about the Python-list mailing list