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 2019-12-10 19:25, R.Wieser wrote:
> Rhodri,
> 
>> the object that is the integer 5 *isn't* deleted
> 
> That was not the question.  And you're now referring to the object as well
> as the integer, which makes it confusing. You also have not explained what
> happens instead.   In short, your above statement has ZERO value to me.
> 
>> On the contrary, it's exactly the point.  You are asserting behaviour that 
>> you are not guaranteed.
> 
> Prove it.  I'm getting a bit fed up with you guys yapping along without
> anything to back anything up.
> 
>> What you disabled wasn't the garbage collector,
> 
> Prove it.  The docs.python.org page I found says something else, starting
> with the pages title being "Garbage Collector".
> 
 From the help:

"""CPython implementation detail: CPython currently uses a 
reference-counting scheme with (optional) delayed detection of 
cyclically linked garbage, which collects most objects as soon as they 
become unreachable, but is not guaranteed to collect garbage containing 
circular references. See the documentation of the gc module for 
information on controlling the collection of cyclic garbage. Other 
implementations act differently and CPython may change. Do not depend on 
immediate finalization of objects when they become unreachable (so you 
should always close files explicitly)."""

Ultimately, the proof of how CPython works is in its source code, which 
is open.

>> And to repeat, you have *no* guarantee *at all* in the language spec that 
>> this will happen.
> 
> There is also absolutily no guarantee in those specs that my 'puter will not
> suddenly transform into a bonzai tree.   Should I now expect it to happen ?
>