[PyQt] Re: SIP - patched methods with lazy lookups

Kevin Watters kevin at digsby.com
Tue Apr 22 18:47:12 BST 2008


> old_init = MyClass.__init__ def new_init(self, foo, bar=5, meep=13):
> old_init(self, foo, bar, meep) MyClass.__init__ = new_init
> 
> assert MyClass.__init__ is new_init # FAIL

Oops. That should be

old_init = MyClass.__init__
def new_init(self, foo, bar=5, meep=13):
    old_init(self, foo, bar, meep)

MyClass.__init__ = new_init

assert MyClass.__init__ is new_init # FAIL




More information about the PyQt mailing list