[PyQt] Re: Virtual methods and an extra reference

2008-07-07 Thread Kevin Watters
It should be fixed in tonight's SIP snapshot. It was just a Py_DECREF() that got dropped. Thanks--the fix looks good in my tests. Although I'm still a bit confused about the long comment for when there's a callable (not a CFunction and not a PyMethod) in the slot. There's still no Py_DECREF in

Re: [PyQt] Re: Virtual methods and an extra reference

2008-07-07 Thread Phil Thompson
On Mon, 7 Jul 2008 16:39:46 + (UTC), Kevin Watters [EMAIL PROTECTED] wrote: It should be fixed in tonight's SIP snapshot. It was just a Py_DECREF() that got dropped. Thanks--the fix looks good in my tests. Although I'm still a bit confused about the long comment for when there's a

Re: [PyQt] Re: Virtual methods and an extra reference

2008-06-23 Thread Sundance
Phil wrote: I will look at this properly when I have the time. Thank you, Phil -- it's appreciated. In the meanwhile, for those who may come across this thread in the future, here's a working workaround (as opposed to the almost-working- but-not-quite one from earlier *g*): 1) Rename the

Re: [PyQt] Re: Virtual methods and an extra reference

2008-06-22 Thread Phil Thompson
On Sun, 22 Jun 2008 02:04:20 + (UTC), Kevin Watters [EMAIL PROTECTED] wrote: The workaround makes my skin crawl. :| I hope you'll be able to whip up a fix, Kevin. I tried, but I screwed up attribute access in a way I didn't understand yet. Disabling the method cache altogether

[PyQt] Re: Virtual methods and an extra reference

2008-06-21 Thread Kevin Watters
The workaround makes my skin crawl. :| I hope you'll be able to whip up a fix, Kevin. I tried, but I screwed up attribute access in a way I didn't understand yet. Disabling the method cache altogether proved a workable temporary fix for me--but I won't want to ship it :) Phil, any

[PyQt] Re: Virtual methods and an extra reference

2008-06-20 Thread Sundance
Kevin wrote: Obviously the usage of the above bound_ref is just for bound methods--but I think using new.instancemethod is more correct than lazily grabbing the bound method with getattr. Hi Kevin, I like the use of new.instancemethod. I like it a /lot/. However: I notice that your code

[PyQt] Re: Virtual methods and an extra reference

2008-06-19 Thread Kevin Watters
Sundance sundance at ierne.eu.org writes: This class behaves like weakref.ref, only for callables. We use a variant of this idea in our app for observable callbacks: class bound_ref(object): def __init__(self, method, cb = None): self.object = weakref_ref(method.im_self, cb)