Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C API] Move _PyEval_EvalFrameDefault() to the internal C API #91006

Closed
vstinner opened this issue Feb 24, 2022 · 11 comments
Closed

[C API] Move _PyEval_EvalFrameDefault() to the internal C API #91006

vstinner opened this issue Feb 24, 2022 · 11 comments
Labels

Comments

@vstinner
Copy link
Member

BPO 46850
Nosy @gpshead, @vstinner, @pablogsal, @brandtbucher, @itamaro
PRs
  • bpo-46850: Move private _PyEval functions to internal C API #31532
  • bpo-46850: Remove _PyEval_SetAsyncGenFinalizer() #32017
  • bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() #32018
  • bpo-46850: Remove _PyEval_CallTracing() function #32019
  • bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API #32052
  • bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API #32054
  • Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" #32343
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2022-04-06.12:01:30.926>
    created_at = <Date 2022-02-24.15:36:24.849>
    labels = ['expert-C-API', 'deferred-blocker', '3.11']
    title = '[C API] Move _PyEval_EvalFrameDefault() to the internal C API'
    updated_at = <Date 2022-04-06.12:01:30.925>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2022-04-06.12:01:30.925>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-04-06.12:01:30.926>
    closer = 'vstinner'
    components = ['C API']
    creation = <Date 2022-02-24.15:36:24.849>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46850
    keywords = ['patch']
    message_count = 11.0
    messages = ['413918', '413919', '413920', '415644', '415646', '415648', '416472', '416476', '416710', '416862', '416863']
    nosy_count = 5.0
    nosy_names = ['gregory.p.smith', 'vstinner', 'pablogsal', 'brandtbucher', 'itamaro']
    pr_nums = ['31532', '32017', '32018', '32019', '32052', '32054', '32343']
    priority = 'deferred blocker'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46850'
    versions = ['Python 3.11']

    @vstinner
    Copy link
    Member Author

    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 ae0a2b7 "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.

    @vstinner vstinner added 3.11 bug and security fixes topic-C-API labels Feb 24, 2022
    @vstinner
    Copy link
    Member Author

    typo: "I propose to move most _PyEval private functions to the internal C API to clarify that they must *NOT* be used." :-)

    @vstinner
    Copy link
    Member Author

    See also bpo-46836: "[C API] Move PyFrameObject to the internal C API".

    @vstinner
    Copy link
    Member Author

    New changeset 332b04b by Victor Stinner in branch 'main':
    bpo-46850: Remove _PyEval_SetAsyncGenFinalizer() (GH-32017)
    332b04b

    @vstinner
    Copy link
    Member Author

    New changeset 9087243 by Victor Stinner in branch 'main':
    bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018)
    9087243

    @vstinner
    Copy link
    Member Author

    New changeset e63894b by Victor Stinner in branch 'main':
    bpo-46850: Remove _PyEval_CallTracing() function (GH-32019)
    e63894b

    @vstinner
    Copy link
    Member Author

    vstinner commented Apr 1, 2022

    New changeset b9a5522 by Victor Stinner in branch 'main':
    bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)
    b9a5522

    @vstinner
    Copy link
    Member Author

    vstinner commented Apr 1, 2022

    New changeset f877b40 by Victor Stinner in branch 'main':
    bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)
    f877b40

    @gpshead
    Copy link
    Member

    gpshead commented Apr 5, 2022

    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)

    @vstinner
    Copy link
    Member Author

    vstinner commented Apr 6, 2022

    New changeset 2b4f2f5 by Victor Stinner in branch 'main':
    Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" (GH-32343)
    2b4f2f5

    @vstinner
    Copy link
    Member Author

    vstinner commented Apr 6, 2022

    @vstinner vstinner closed this as completed Apr 6, 2022
    @vstinner vstinner closed this as completed Apr 6, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants