Discussion:
back in the 20th century (rant/ flame)
(too old to reply)
Rainer Weikusat
2020-09-22 17:18:08 UTC
Permalink
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 (ex:
always close files).

----------

Translation into plain English: Due to ideological blindless, our
automatic resource management system does not and won't ever support
automatically manageing anything but memory. That's fine as we duly
believe that anything but memory is magical and that the same, eternally
fallible humans we claim to be incapable of manageing memory correctly
will always manage everything else correclty.

It's really a matter of naming, as with all magic: If a set of functions
is called malloc and free, using them correctly is impossible. If
they're called open and close (or lock and unloch) using them
incorrectly is impossible!

On towards another 70 years of fiddling with tracing collectors !!

Nothing else matters !!!

[to us]
Jorgen Grahn
2020-09-22 19:04:18 UTC
Permalink
Post by Rainer Weikusat
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
always close files).
----------
Translation into plain English: Due to ideological blindless, our
automatic resource management system does not and won't ever support
automatically manageing anything but memory. That's fine as we duly
believe that anything but memory is magical and that the same, eternally
fallible humans we claim to be incapable of manageing memory correctly
will always manage everything else correclty.
Back when I still cared about Python (10--15 years ago) I interpreted
it simply as:

"We may want to run in the JVM at some point, so you should start
paying the Java tax now."

I wrote code that relied on timely destruction anyway.
That was before the "with foo as bar:" construct.

/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Loading...