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.

classification
Title: [C API] Move _PyEval_EvalFrameDefault() to the internal C API
Type: Stage: resolved
Components: C API Versions: Python 3.11
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: brandtbucher, gregory.p.smith, itamaro, pablogsal, vstinner
Priority: deferred blocker Keywords: patch

Created on 2022-02-24 15:36 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31532 closed vstinner, 2022-02-24 15:42
PR 32017 merged vstinner, 2022-03-20 23:44
PR 32018 merged vstinner, 2022-03-21 00:42
PR 32019 merged vstinner, 2022-03-21 01:27
PR 32052 merged vstinner, 2022-03-22 15:51
PR 32054 merged vstinner, 2022-03-22 16:37
PR 32343 merged vstinner, 2022-04-05 21:07
Messages (11)
msg413918 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-02-24 15:36
In Python 3.10, _PyEval_EvalFrameDefault() has the API:

PyObject* _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag);

In Python 3.11, bpo-44590 (commit ae0a2b756255629140efcbe57fc2e714f0267aa3 "Lazily allocate frame objects (GH-27077)") changed it to:

PyObject* _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int throwflag);

Problem: InterpreterFrame is part of the internal C API.

By the way, PyInterpreterState.eval_frame type (_PyFrameEvalFunction) also changed. This field type already changed in Python 3.9:

* ``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory
  *tstate* parameter (``PyThreadState*``).
  (Contributed by Victor Stinner in :issue:`38500`.)

Maybe the Python 3.11 change should be documented in What's New in Python 3.11, as it was in What's New in Python 3.9.


I propose to move most _PyEval private functions to the internal C API to clarify that they must be used.
msg413919 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-02-24 15:42
typo: "I propose to move most _PyEval private functions to the internal C API to clarify that they must *NOT* be used." :-)
msg413920 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-02-24 15:43
See also bpo-46836: "[C API] Move PyFrameObject to the internal C API".
msg415644 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-03-21 00:15
New changeset 332b04bac35cd7305c60da2d5733940dc089949a by Victor Stinner in branch 'main':
bpo-46850: Remove _PyEval_SetAsyncGenFinalizer() (GH-32017)
https://github.com/python/cpython/commit/332b04bac35cd7305c60da2d5733940dc089949a
msg415646 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-03-21 01:24
New changeset 9087243e2c167e38570e819b228efc3492c38c9c by Victor Stinner in branch 'main':
bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018)
https://github.com/python/cpython/commit/9087243e2c167e38570e819b228efc3492c38c9c
msg415648 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-03-21 02:03
New changeset e63894b3eed8ad2dd7690695f7f07bfbff59c05a by Victor Stinner in branch 'main':
bpo-46850: Remove _PyEval_CallTracing() function (GH-32019)
https://github.com/python/cpython/commit/e63894b3eed8ad2dd7690695f7f07bfbff59c05a
msg416472 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-04-01 08:18
New changeset b9a5522dd952125a99ff554f01f311cae25f5a91 by Victor Stinner in branch 'main':
bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)
https://github.com/python/cpython/commit/b9a5522dd952125a99ff554f01f311cae25f5a91
msg416476 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-04-01 08:55
New changeset f877b40e3f7e0d97878884d80fbec879a85ab7e8 by Victor Stinner in branch 'main':
bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)
https://github.com/python/cpython/commit/f877b40e3f7e0d97878884d80fbec879a85ab7e8
msg416710 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-04-05 00:53
per https://mail.python.org/archives/list/python-dev@python.org/message/GFOMU7LP63JUVFMWNJNZJLUMZDRPTUYJ/ lets roll some of those PRs back and reshape where we move these APIs as despite the PEP they were not as private as other privates.

(deferred blocker meaning: block 3.11beta1 - though Pablo could decide to have the rollbacks block 3.11alpha7)
msg416862 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-04-06 11:58
New changeset 2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c by Victor Stinner in branch 'main':
Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" (GH-32343)
https://github.com/python/cpython/commit/2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c
msg416863 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-04-06 12:01
The change was rejected by the Steering Council:
https://mail.python.org/archives/list/python-dev@python.org/message/GFOMU7LP63JUVFMWNJNZJLUMZDRPTUYJ/
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 91006
2022-04-06 12:01:30vstinnersetstatus: open -> closed
resolution: rejected
messages: + msg416863

stage: patch review -> resolved
2022-04-06 11:58:12vstinnersetmessages: + msg416862
2022-04-05 21:07:53vstinnersetpull_requests: + pull_request30397
2022-04-05 00:53:35gregory.p.smithsetpriority: normal -> deferred blocker
nosy: + gregory.p.smith, pablogsal
messages: + msg416710

2022-04-01 08:55:13vstinnersetmessages: + msg416476
2022-04-01 08:18:08vstinnersetmessages: + msg416472
2022-03-23 16:47:14itamarosetnosy: + itamaro
2022-03-22 16:37:07vstinnersetpull_requests: + pull_request30144
2022-03-22 15:51:47vstinnersetpull_requests: + pull_request30141
2022-03-21 02:03:35vstinnersetmessages: + msg415648
2022-03-21 01:27:31vstinnersetpull_requests: + pull_request30107
2022-03-21 01:24:18vstinnersetmessages: + msg415646
2022-03-21 00:42:46vstinnersetpull_requests: + pull_request30106
2022-03-21 00:15:51vstinnersetmessages: + msg415644
2022-03-20 23:44:02vstinnersetpull_requests: + pull_request30105
2022-02-25 18:35:25brandtbuchersetnosy: + brandtbucher
2022-02-24 15:43:28vstinnersetmessages: + msg413920
2022-02-24 15:42:46vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request29676
2022-02-24 15:42:28vstinnersetmessages: + msg413919
2022-02-24 15:36:24vstinnercreate