[Python-Dev] Design question: call del only after successful init? (original) (raw)

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 .

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