STINNER Victor <vstin...@python.org> added the comment:

Py_NewInterpreter() (new_interpreter() in practice) and Py_InitializeEx() now 
share almost all their code.

Py_EndInterpreter() shares almost all its code with Py_Finalizer(). It's not 
perfect, but it's way better than previously.

Py_NewInterpreter() now isolates more things from the main interpreter. For 
example, builtins and sys modules no longer copy the module dictionary of the 
main interpreter, but create their own dictionary from scratch.

See each commit for the details.

Py_Finalizer() could share more code with Py_EndInterpreter(), but each 
Py_Finalizer() change is really tricky and require to pay a lot attention. The 
Python finalization is really fragile. I started to take notes on this fragile 
code:
https://pythondev.readthedocs.io/finalization.html

I consider that the initial issue is fixed, so I close the issue.

----------
nosy: +eric.snow
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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

Reply via email to