osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python3 - How do I import a class from another file


On Tue, 10 Dec 2019 at 21:12, R.Wieser <address at not.available> wrote:
> And although you have been fighting me over when the __del__ method is
> called, it /is/ called directly as a result of an "del instance" and the
> refcount goes zero.  There is /no/ delay.    (with the only exception is
> when a circular reference exists).

You do understand that the reference counting garbage collector is an
implementation detail of the CPython implementation *only*, don't you?
The (implementation independent) language semantics makes no assertion
about what form of garbage collection is used, and under other garbage
collectors, there can be an indefinite delay between the last
reference to a value being lost and the object being collected (which
is when __del__ gets called). There is not even a guarantee that
CPython will retain the reference counting GC in future versions.
Removing it would be a big change, but not impossible.

If all you are interested is the semantics of the current CPython
release, then your statements are true. But why would anyone here know
that you were looking at the situation from such a limited
perspective?

Your "logic" seems to be full of hidden assumptions and unstated
qualifications. And your attitude seems to be confrontational and
aggressive. Frankly, it's unlikely that you're going to learn much
without a change in your approach.

Paul