[Python-3000] del (was Re: PEPs update) (original) (raw)

Phillip J. Eby pje at telecommunity.com
Fri May 11 01:54:58 CEST 2007


At 07:27 PM 5/10/2007 -0400, Raymond Hettinger wrote:

The PEP for eliminating del seemed straight-forward at the outset, but the use case you presented doesn't seem to have a clean substitute (as it requires the object to be alive to finalize it). Other use cases do have a clean solution. So, I'll go forward with the PEP but am a bit disheartened that it is going to have to advise try/finally or somesuch for the harder cases.

By the way - another issue with removing del is that try/finally in generators (PEP 342) is implemented using it.

Which means that if you took away del from the Python level, you could still simulate it by saving a reference to a running generator with a finally clause. Of course, that would have at least as many problems as using del directly, but there you go. :)



More information about the Python-3000 mailing list