On Thu, Mar 1, 2018 at 9:51 AM,  <ooom...@gmail.com> 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.
>

If it were that simple, why do you think it isn't currently mandated?

Here's one example: reference cycles. When do they get detected?
Taking a really simple situation:

class Foo:
    def __init__(self):
        self.self = self
        print("Creating a Foo")
    def __del__(self):
        print("Disposing of a Foo")

foo = Foo()
foo = 1

When do you expect __del__ to be called? How do you implement this
efficiently and reliably?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to