Commit c60137b2 authored by Gregory P. Smith's avatar Gregory P. Smith

Explicitly mention that people should not depend on immediate

finalization of objects in the language reference.
parent 2d1e88a4
...@@ -69,6 +69,8 @@ are still reachable. ...@@ -69,6 +69,8 @@ are still reachable.
containing circular references. See the documentation of the :mod:`gc` containing circular references. See the documentation of the :mod:`gc`
module for information on controlling the collection of cyclic garbage. module for information on controlling the collection of cyclic garbage.
Other implementations act differently and CPython may change. Other implementations act differently and CPython may change.
Do not write code that depends on immediate finalization of objects
when they become unreachable (ex: always close your files).
Note that the use of the implementation's tracing or debugging facilities may Note that the use of the implementation's tracing or debugging facilities may
keep objects alive that would normally be collectable. Also note that catching keep objects alive that would normally be collectable. Also note that catching
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment