Class destructor

Mongryong Mongryong at
Thu Feb 13 22:48:45 CET 2003

On Thu, 2003-02-13 at 14:42, Jp Calderone wrote:
>   "Lost pointer" (Which I believe is a less commonly used term for "dangling
> pointer", though I may be mistaken) in C is when a pointer refers to an area
> of memory that has been freed.  This isn't the case in Python, as it is
> [almost] impossible to refer to freed memory locations.
The side-effect of a 'lost pointer' is a 'memory leak'.  This is
different than a 'dangling pointer'.

In the original poster's example, what would happen if he used a
'weakref'?  In this case, would it still matter or not that 'class A'
has defined a '__del__' method?

More information about the Python-list mailing list