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-January/070752.html below:

[Python-Dev] Object creation hook

[Python-Dev] Object creation hook [Python-Dev] Object creation hookKristján V. Jónsson kristjan at ccpgames.com
Tue Jan 23 15:21:56 CET 2007
Hello there.
I am trying to insert a hook into python enabling a callback for all just-created objects.  The intention is to debug and find memory leaks, e.g. by having the hook function insert the object into a WeakKeyDictionary.
I have already added a method to "object" to set such a hook, and "object_new" now calls it upon completion, but this is far from covering all places.  Initially, I thought object_init were the place, but almost no classes call object.__init__ from their __init__ method.  Then there is the separate case of old-style classes.

Any suggestions on how to do a global object creation hook in python?

Kristján
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20070123/66ca027d/attachment.htm 
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