Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c60137b

Browse files
committed
Explicitly mention that people should not depend on immediate
finalization of objects in the language reference.
1 parent 2d1e88a commit c60137b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Doc/reference/datamodel.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ are still reachable.
6969
containing circular references. See the documentation of the :mod:`gc`
7070
module for information on controlling the collection of cyclic garbage.
7171
Other implementations act differently and CPython may change.
72+
Do not write code that depends on immediate finalization of objects
73+
when they become unreachable (ex: always close your files).
7274

7375
Note that the use of the implementation's tracing or debugging facilities may
7476
keep objects alive that would normally be collectable. Also note that catching

0 commit comments

Comments
 (0)