RFC: Proposal: Deterministic Object Destruction

Rick Johnson rantingrickjohnson at gmail.com
Wed Feb 28 21:51:33 EST 2018


On Wednesday, February 28, 2018 at 5:50:53 PM UTC-6, Steven D'Aprano wrote:
> On Wed, 28 Feb 2018 14:51:09 -0800, ooomzay wrote:
> > 
> > [...]
> >
> > Specification
> > =============
> > 
> > When the last reference to an object goes out of scope the
> > intepreter must synchronously, in the thread that releases
> > the last reference, invoke the object's __del__() method
> > and then free the memory occupied by that object.
> 
> What happens if the __del__ method recreates a reference to
> the object?

So make instantation of the object in its __del__ method an illegal op!





More information about the Python-list mailing list