A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-March/071455.html below:

[Python-Dev] Class destructor

[Python-Dev] Class destructorNick Maclaren nmm1 at cus.cam.ac.uk
Fri Mar 2 10:53:21 CET 2007
Sorry about a second message, but I mentioned this aspect earlier,
and it is semi-independent.

If I want to produce statistics, such as the times spent in various
operations, I need a callback when the class is disposed of.  Now,
that WOULD be inconvenient to use the C object attribute callback,
unless I could be sure that would be called while the class structure
is still around.  That could be resolved by taking a copy, of course,
but that is messy.

This also relates to one of my problems with the callback.  I am not
being called back if the class is still live at program termination;
ones that have had their use counts drop to zero do cause a callback,
but not ones whose use count is above zero.  I am not sure whether
this is my error or a feature of the garbage collector.

If the latter, it doesn't matter from the point of view of freeing
space, but is assuredly a real pain for producing statistics.  I
haven't looked into it, as it is not an immediate task.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1 at cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679
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