At 05:24 PM 2/28/2007 +0000, Nick Maclaren wrote:
>I suppose that I could add a C object as an attribute that points to
>a block of memory that contains copies of all my workspace pointers,
>and use the object deallocator to clean up.  If all else fails, I
>will try that, but it seems a hell of a long way round for what I
>would have thought was a basic requirement.

Well, you could use a custom metaclass with a tp_dealloc or whatever.  But 
I just mainly meant that a PyCObject is almost as good as a weakref for 
certain purposes -- i.e. it's got a pointer and a callback.

You could of course also use weak references, but that's a bit more awkward 
as well.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to