Re: [Python-Dev] Weak references: dereference notification

2005-11-11 Thread Greg Ewing
Gustavo J. A. M. Carneiro wrote: > The object isn't really destroyed. Simply ob_refcnt drops to zero, > then tp_dealloc is called, which is supposed to destroy it. But since I > wrote tp_dealloc, I choose not to destroy it, Be aware that a C subclass of your wrapper that overrides tp_dealloc

Re: [Python-Dev] Weak references: dereference notification

2005-11-10 Thread Gustavo J. A. M. Carneiro
Qui, 2005-11-10 às 13:57 +1300, Greg Ewing escreveu: > Gustavo J. A. M. Carneiro wrote: > > > OK, but what if it is a subclass of a builtin type, with instance > > variables? What if the PyObject is GC'ed but the ObjC object remains > > alive, and later you get a new reference to it? Do you cr

Re: [Python-Dev] Weak references: dereference notification

2005-11-10 Thread Gustavo J. A. M. Carneiro
Qui, 2005-11-10 às 08:15 +0100, "Martin v. Löwis" escreveu: > Gustavo J. A. M. Carneiro wrote: > > OK, but what if it is a subclass of a builtin type, with instance > > variables? What if the PyObject is GC'ed but the ObjC object remains > > alive, and later you get a new reference to it? Do yo

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Martin v. Löwis
Gustavo J. A. M. Carneiro wrote: > OK, but what if it is a subclass of a builtin type, with instance > variables? What if the PyObject is GC'ed but the ObjC object remains > alive, and later you get a new reference to it? Do you create a new > PyObject wrapper for it? What happened to the inst

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Ronald Oussoren
On 9-nov-2005, at 23:44, Gustavo J. A. M. Carneiro wrote: > On Wed, 2005-11-09 at 20:40 +0100, Ronald Oussoren wrote: >> On 9-nov-2005, at 18:52, Gustavo J. A. M. Carneiro wrote: >> >>> Qua, 2005-11-09 às 09:23 -0800, Guido van Rossum escreveu: >> Gustavo J. A. M. Carneiro wrote: >>> I

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Greg Ewing
Gustavo J. A. M. Carneiro wrote: > OK, but what if it is a subclass of a builtin type, with instance > variables? What if the PyObject is GC'ed but the ObjC object remains > alive, and later you get a new reference to it? Do you create a new > PyObject wrapper for it? What happened to the ins

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Gustavo J. A. M. Carneiro
On Wed, 2005-11-09 at 20:40 +0100, Ronald Oussoren wrote: > On 9-nov-2005, at 18:52, Gustavo J. A. M. Carneiro wrote: > > > Qua, 2005-11-09 às 09:23 -0800, Guido van Rossum escreveu: > Gustavo J. A. M. Carneiro wrote: > > I have come across a situation where I find the current weak > >>

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Ronald Oussoren
On 9-nov-2005, at 18:52, Gustavo J. A. M. Carneiro wrote: > Qua, 2005-11-09 às 09:23 -0800, Guido van Rossum escreveu: Gustavo J. A. M. Carneiro wrote: > I have come across a situation where I find the current weak > references interface for extension types insufficient. >

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Gustavo J. A. M. Carneiro
Qua, 2005-11-09 às 09:23 -0800, Guido van Rossum escreveu: > > > Gustavo J. A. M. Carneiro wrote: > > > > I have come across a situation where I find the current weak > > > > references interface for extension types insufficient. > > > > > > > > Currently you only have a tp_weaklistoffset slot,

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Guido van Rossum
> > Gustavo J. A. M. Carneiro wrote: > > > I have come across a situation where I find the current weak > > > references interface for extension types insufficient. > > > > > > Currently you only have a tp_weaklistoffset slot, pointing to a > > > PyObject with weak references. However, in my c

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Gustavo J. A. M. Carneiro
Qua, 2005-11-09 às 11:50 -0500, Jim Fulton escreveu: > Gustavo J. A. M. Carneiro wrote: > > Hello, > > > > I have come across a situation where I find the current weak > > references interface for extension types insufficient. > > > > Currently you only have a tp_weaklistoffset slot, pointi

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Jim Fulton
Gustavo J. A. M. Carneiro wrote: > Hello, > > I have come across a situation where I find the current weak > references interface for extension types insufficient. > > Currently you only have a tp_weaklistoffset slot, pointing to a > PyObject with weak references. However, in my case[1] I