Tim Peters added the comment:

There's no way to influence finalization order for objects in cycles, and there 
never was.  So nothing actually changed in that respect ;-)  What did change is 
that Python used to forcibly break many module-level cycles in a way that just 
happened to result in the finalization order you wanted.

Outside of cycles it's still as predictable as before.  For example, you could 
reliably get the finalization order you want by replacing the last two lines 
with

p.child()
p.child()

Then the children aren't in cycles, and will be finalized first.  But that's 
still due to other CPython implementation details (which haven't yet changed), 
not to language guarantees.

But an atexit handler sounds like a saner way to proceed :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21351>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to