[Python-Dev] Design question: call __del__ only after successful __init__?

Tim Peters tim_one@email.msn.com
Mon, 6 Mar 2000 02:33:49 -0500


[M.-A. Lemburg, on the resurrection/multiple-__del__ "idiom"]
> ...
> The idea came from a different area: the C implementation
> of Python uses free lists a lot and these are basically
> implementations of the same idiom: save an allocated
> resource for reviving it at some later point.

Excellent analogy!  Thanks.  Now that you phrased it in this clarifying way,
I recall that very much the same point was raised in the papers that
resulted in the creation of guardians in Scheme.  I don't know that anyone
is actually using Python __del__ this way today (I am not), but you reminded
me why I thought it was natural at one time <wink>.

generally-__del__-aversive-now-except-in-c++-where-destructors-are-
    guaranteed-to-be-called-when-you-except-them-to-be-ly y'rs  - tim