A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-February/071416.html below:

[Python-Dev] Class destructor

[Python-Dev] Class destructor [Python-Dev] Class destructorPhillip J. Eby pje at telecommunity.com
Wed Feb 28 18:51:16 CET 2007
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.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4