On Tue, Aug 2, 2011 at 8:24 AM, Jim Bosch wrote:
>
> Hmm. That might mean you need to do a big design change; while it often
> works, one really isn't supposed to rely on __del__ being called when a
> Python object first could be garbage-collected - when cycles are involved,
> Python doesn't eve
On 08/01/2011 09:44 PM, diego_pmc wrote:
Are these cycles actually a problem in practice? Python does do
garbage
collection, so it might be that it knows about all these dependencies
and just hasn't bothered to try to delete them because it doesn't need
the memory yet.
Y
On Tue, Aug 2, 2011 at 3:00 AM, Nat Goodspeed wrote:
>
>
> http://docs.python.org/library/weakref.html#module-weakref
>
>
Unfortunately, I can't use `weakref` I already tried that, but the problem
is that the weak references get deleted (and their value set to `None`)
before `__del__` is called. S
On 08/01/2011 07:50 AM, diego_pmc wrote:
I have an `EventManager` class written in C++ and exposed to Python. This is
how I intended for it to be used from the Python side:
class Something:
def __init__(self):
EventManager.addEventHandler(FooEvent, self.onFooEvent)
On Aug 1, 2011, at 10:50 AM, diego_pmc wrote:
> How should I capture Python function objects such
> that I won't increase their reference count? I only need a weak reference to
> the objects.
http://docs.python.org/library/weakref.html#module-weakref
I don't know how to access a Python weakref
I have an `EventManager` class written in C++ and exposed to Python. This is
how I intended for it to be used from the Python side:
class Something:
def __init__(self):
EventManager.addEventHandler(FooEvent, self.onFooEvent)
def __del__(self):
EventManag