Notification when reference count goes to 0?

Jive Dadson sfsdasdfa at isdfsdfa.invalid
Mon Dec 23 01:46:30 EST 2002


Robert Oschler wrote:
> 
> Is there a way to get notification when the reference count goes to 0 on an
> object? The only thing I miss from C++ is destructors.  If there was a way
> to get notified when an object's reference count went to 0, the automatic
> release of associated resources would be possible, yes?  Just to be
> explicit, I'm not interested in garbage collection based finalization, as
> everyone knows the timing or even the occurrence of such an event comes
> under the heading of 'unspecified behavior', at least with Java it is.
> 
> thx

Look in a reference book or documentation for the __del__ member
function.  (Two days ago I couldn't even spell Pythan, and now am one.)

J.



More information about the Python-list mailing list