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")

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to