This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients BTaskaya, corona10, dino.viehland, eric.snow, lukasz.langa, mjacob, pablogsal, petr.viktorin, shihai1991, vstinner
Date 2020-09-10.13:55:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1599746118.3.0.903298401372.issue41631@roundup.psfhosted.org>
In-reply-to
Content
About subinterpreters. In Python 3.8, _ast.AST type is a static type:

static PyTypeObject AST_type = {...};

In Python 3.9, it's now a heap type:

static PyType_Spec AST_type_spec = {...};
state->AST_type = PyType_FromSpec(&AST_type_spec);

In Python 3.8, the same _ast.AST type was shared by all interpreters. With my PR 21961, the _ast.AST type is a heap type but it is also shared by all interpreters.

Compared to Python 3.8, PR 21961 has no regression related to subinterpreters. It's not better nor worse. The minor benefit is that _ast.AST is cleared at Python exit (see _PyAST_Fini()).

While I would be nice to make _ast.AST per interpreter, it would be an *enhancement*. I consider that it can wait for Python 3.10.
History
Date User Action Args
2020-09-10 13:55:18vstinnersetrecipients: + vstinner, dino.viehland, petr.viktorin, lukasz.langa, eric.snow, mjacob, corona10, pablogsal, BTaskaya, shihai1991
2020-09-10 13:55:18vstinnersetmessageid: <1599746118.3.0.903298401372.issue41631@roundup.psfhosted.org>
2020-09-10 13:55:18vstinnerlinkissue41631 messages
2020-09-10 13:55:18vstinnercreate