◐ Shell
clean mode source ↗

Message 376983 - Python tracker

In September 2019, the _ast extension module was converted to PEP 384 (stable ABI): bpo-38113.

In bpo-41631, I moved the _ast module state back to a global state, rather than a regular module state, to fix multiple bugs.

The state should be made per intepreter (moved into PyInterpreterState).

Also, each interpreter should have its own _ast types (_ast.AST, _ast.Constant, etc.), rather than sharing all types.

Hopefully, in 3.9, _ast types have been converted to heap types.

To fix bpo-41631, I wanted to convert _ast.AST heap type back into a static type, to prevenet a subinterpreter to modify it, but Petr Viktorin asked me to leave it as it is:
https://github.com/python/cpython/pull/21961#issuecomment-685821519

I agree since I would like to convert all static types to heap types: bpo-40077.