From: Bill Soudan Date: Wed Nov 26, 2003 05:21:50 Europe/London To: mwh@python.net Subject: PEP 310/object lifetimes? Hi Michael, You mention in PEP-310: If a way of controlling object lifetimes explicitly was available, the function of the __exit__ hook could be taken over by the existing __del__ hook. Unfortunately, no workable proposal for controlling object lifetimes has been made so far. I've recently been wishing for the ability to control an object's lifetime in Python. I also think it would be a more elegant solution than the __enter__ and __exit__ hooks, for instance, no need to retro-fit existing classes. I did a bit of digging, but I couldn't come up with much. Has it been discussed before, and if so, do you remember where? And does your comment mean it isn't possible given the current implementation? Thanks, Bill