[Pyrex] weak references to Pyrex instances?

Phillip J. Eby pje at telecommunity.com
Mon Oct 4 16:35:25 CEST 2004


At 12:13 AM 10/4/04 -0400, vng1 at mac.com wrote:
>Hi all - what do I need to do to make a Pyrex class weak reference-able?

Well, you can probably subclass it in Python and add:

     __slots__ = '__weakref__'

in the subclass, which will tell Python to make it weak referenceable.  At 
least it works for other types.

I don't know for sure if it works with Pyrex, nor do I know a better way to 
do it with Pyrex.





More information about the Pyrex mailing list