RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

Gregory Ewing greg.ewing at canterbury.ac.nz
Sat Mar 3 21:27:45 EST 2018


Richard Damon wrote:
> The 
> idea was to have a way to mark that certain classes/objects request that 
> they are reference counted so they get the __del__ called as soon as the 
> last reference goes away, without needing to require that overhead for 
> all objects in all implementations.

That could be done with a flag in the object or type header.
But checking the flag every time a reference is added or
removed is probably about as expensive as doing the refcount
adjustment.

-- 
Greg



More information about the Python-list mailing list