[ZODB-Dev] weakref and Persistent

Phillip J. Eby pje at telecommunity.com
Wed Apr 23 16:54:23 EDT 2003


At 03:26 PM 4/23/03 -0400, Jeremy Hylton wrote:
>On Wed, 23 Apr 2003 21:01:27 +0200
>  Dieter Maurer <dieter at handshake.de> wrote:
> > Christian Reis wrote at 2003-4-22 20:16 -0300:
> >  > ...
> >  > In the Python doc it says "Extension types can easily
> > be made to support
> >  > weak references"
> >
> > Read this carefully:
> >
> >   It says: Extension types must do something to support
> >   weak references also this is not difficult.
> >
> > As you found out "ZODB.Persistence.Persistent" does not
> > do this.
>
>I think it could, but I've got no time to do it.
>
>Jeremy

Looks like you already did it in ZODB4:

 >>> from persistence import Persistent
 >>> class foo(Persistent): pass

 >>> f=foo()
 >>> from weakref import ref
 >>> g=ref(f)
 >>> g
<weakref at 0xaf5a90; to 'foo' at 0xae5a40>
 >>> del f
 >>> g
<weakref at af5a90; dead>
 >>>

Been borrowing Guido's time machine, have we?  :)




More information about the ZODB-Dev mailing list