[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-03-22 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-47092: [C API] Add PyFrame_GetVar(frame, name) function. -- ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-03-03 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-03-02 Thread Mark Shannon
Mark Shannon added the comment: I've outlined the requirements for a frame stack API at https://github.com/faster-cpython/ideas/issues/309. The problem with adding an API for PyFrameObject (beyond simple getters) is that it makes assumptions about the frame stack that aren't valid. A stack

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-03-01 Thread STINNER Victor
STINNER Victor added the comment: I searched for "\<_f" regex in Cython (0.29.x) branch. I found the following code getting or setting PyFrameObject fields. == Set f_back == __Pyx_Coroutine_SendEx() at Utility/Coroutine.c:721: f->f_back = PyThreadState_GetFrame(tstate);

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8a716bc62c8205bb9deeda17422b7e69204b6897 by Victor Stinner in branch 'main': bpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536) https://github.com/python/cpython/commit/8a716bc62c8205bb9deeda17422b7e69204b6897 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread miss-islington
miss-islington added the comment: New changeset 763e23e11e785162f9d68f83539404af8e863748 by Miss Islington (bot) in branch '3.9': bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535) https://github.com/python/cpython/commit/763e23e11e785162f9d68f83539404af8e863748 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread miss-islington
miss-islington added the comment: New changeset b0de6299a840a397d4fe3e6c98159d9f258d3295 by Miss Islington (bot) in branch '3.10': bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535) https://github.com/python/cpython/commit/b0de6299a840a397d4fe3e6c98159d9f258d3295 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +29662 pull_request: https://github.com/python/cpython/pull/31538 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 78859e58e4e016286e648d1dc155e0f6cebfa6ff by Victor Stinner in branch 'main': bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535) https://github.com/python/cpython/commit/78859e58e4e016286e648d1dc155e0f6cebfa6ff --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +29661 pull_request: https://github.com/python/cpython/pull/31537 ___ Python tracker

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > I found the uwsgi project on PyPI which uses f_lasti with PyCode_Addr2Line(). Oh, plugins/python/profiler.c uses that to define PyFrame_GetLineNumber() on Python older than 2.7, Python 3.0 and Python 3.1. In 2022, it's no longer relevant. But well, there

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: Mark Shannon: > The only purpose of `f_lasti` is to get the line number and that can be done > directly via `PyFrame_GetLineNumber(PyFrameObject *frame)` I found the uwsgi project on PyPI which uses f_lasti with PyCode_Addr2Line(). I wrote GH-31536 to

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29660 pull_request: https://github.com/python/cpython/pull/31536 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: Ned Batchelder: > I went ahead and changed the coverage.py code to this: (...) I proposed a coverage PR using PyObject_GetAttrString(frame, "f_lasti") which should works on all Python versions: https://github.com/nedbat/coveragepy/pull/1331 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > The docs for PyFrame_GetCode say it's returning an "int". Oh. I missed your comment. I created GH-31535 to fix the return type in the documentation. -- ___ Python tracker

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29659 pull_request: https://github.com/python/cpython/pull/31535 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-46836: "[C API] Move PyFrameObject to the internal C API". -- ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-22 Thread STINNER Victor
STINNER Victor added the comment: The f_code member has been removed by in bpo-44032 by the commit b11a951f16f0603d98de24fee5c023df83ea552c. The f_frame member has been added in bpo-44590 by the commit ae0a2b756255629140efcbe57fc2e714f0267aa3. See also bpo-46355 [C API] Document

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-22 Thread STINNER Victor
STINNER Victor added the comment: The gevent project is not compatible with Python 3.11: it gets and sets directly PyFrameObject.f_code member which has been removed in Python 3.11 (moved to PyFrameObject.f_frame.f_code internal C API). gevent issue:

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2021-12-20 Thread Petr Viktorin
Petr Viktorin added the comment: The docs for PyFrame_GetCode say it's returning an "int". https://docs.python.org/3/c-api/reflection.html#c.PyFrame_GetCode Same for PyFrame_GetBack. Are there more? "Get the frame code." is not very clear. Could this link to

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2021-11-10 Thread Ned Batchelder
Ned Batchelder added the comment: I went ahead and changed the coverage.py code to this: #if PY_VERSION_HEX >= 0x030B00A0 // 3.11 moved f_lasti into an internal structure. This is totally the wrong way // to make this work, but it's all I've got until https://bugs.python.org/issue40421 // is

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2021-10-13 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-45247: [C API] Add explicit support for Cython to the C API. -- ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2021-10-13 Thread STINNER Victor
STINNER Victor added the comment: The coverage project has a ctrace C extension which access PyFrameObject.f_lasti which is gone in Python 3.11. It uses MyFrame_lasti() helper to handle Python 3.10 lasti change: --- // The f_lasti field changed meaning in 3.10.0a7. It had been bytes, but //

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-12-16 Thread STINNER Victor
STINNER Victor added the comment: New changeset 166286849048eccadecf02b242dbc4042b780944 by Victor Stinner in branch '3.9': Add symbols of the stable ABI to python3dll.c (GH-23598) (GH-23801) https://github.com/python/cpython/commit/166286849048eccadecf02b242dbc4042b780944 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-12-16 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22659 pull_request: https://github.com/python/cpython/pull/23801 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-12-16 Thread STINNER Victor
STINNER Victor added the comment: New changeset fcc6935384b933fbe1a1ef659ed455a3b74c849a by Victor Stinner in branch 'master': Add symbols of the stable ABI to python3dll.c (GH-23598) https://github.com/python/cpython/commit/fcc6935384b933fbe1a1ef659ed455a3b74c849a --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-12-01 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22464 pull_request: https://github.com/python/cpython/pull/23598 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-05-08 Thread Stefan Behnel
Stefan Behnel added the comment: Adding to the list above: "f_lasti" is used in "libpython.py", which is an almost exact copy of the one in CPython's "Tools/gdb/" for debugging Python code in gdb. If that implementation changes, we can probably adapt, especially since it uses runtime

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-05-07 Thread STINNER Victor
STINNER Victor added the comment: > Please don't add any setter functions, that would a major change to the VM > and would need a PEP. There is no such "major change". PyFrameObject structure was fully exposed in the public C API since the earliest Python version. I don't see how adding

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-05-07 Thread Mark Shannon
Mark Shannon added the comment: "maybe a few setter functions as well" Please don't add any setter functions, that would a major change to the VM and would need a PEP. Also, could you remove PyFrame_GetLastInstr(PyFrameObject *frame)? The only purpose of `f_lasti` is to get the line number

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset 703647732359200c54f1d2e695cc3a06b9a96c9a by Victor Stinner in branch 'master': bpo-40421: Add PyFrame_GetBack() function (GH-19765) https://github.com/python/cpython/commit/703647732359200c54f1d2e695cc3a06b9a96c9a --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
STINNER Victor added the comment: I looked how Cython uses PyFrameObject: * read f_lasti * read/write f_back * write f_lineno * read f_localsplus * read/write f_trace Details: * Cython/Debugger/libpython.py: code using the Python API of gdb to read PyFrameObject.f_lasti. It it used to

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19086 pull_request: https://github.com/python/cpython/pull/19765 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19085 pull_request: https://github.com/python/cpython/pull/19764 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset a42ca74fa30227e2f89a619332557cf093a937d5 by Victor Stinner in branch 'master': bpo-40421: Add PyFrame_GetCode() function (GH-19757) https://github.com/python/cpython/commit/a42ca74fa30227e2f89a619332557cf093a937d5 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19079 pull_request: https://github.com/python/cpython/pull/19757 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset b8f704d2190125a7750b50cd9b67267b9c20fd43 by Victor Stinner in branch 'master': bpo-40421: Add Include/cpython/code.h header file (GH-19756) https://github.com/python/cpython/commit/b8f704d2190125a7750b50cd9b67267b9c20fd43 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19077 pull_request: https://github.com/python/cpython/pull/19756 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7c59d7c9860cdbaf4a9c26c9142aebd3259d046e by Victor Stinner in branch 'master': bpo-40421: Add pyframe.h header file (GH-19755) https://github.com/python/cpython/commit/7c59d7c9860cdbaf4a9c26c9142aebd3259d046e --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +19076 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19755 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-04-28 Thread STINNER Victor
New submission from STINNER Victor : Similarly to bpo-39573 (make PyObject opaque) and bpo-39947 (make PyThreadState opaque), I propose to add getter functions to access PyFrameObject members without exposing the PyFrameObject structure in the C API. The first step is to identify common