Uh oh!
There was an error while loading. Please reload this page.
gh-87175: Port curses capi pointer array to a struct. - #24304
gh-87175: Port curses capi pointer array to a struct.#24304shihai1991 wants to merge 11 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
vstinner
left a comment
There was a problem hiding this comment.
Hum, this change is backward incompatible. I don't know how to proceed. Is this API used outside Python, in 3rd party projects?
@encukou@serhiy-storchaka@methane: Is this change reasonable?
Note: I asked @shihai1991 to write this change ;-)
Uh oh!
There was an error while loading. Please reload this page.
methane
commented
Jan 26, 2021
The only user I found is this. |
vstinner
commented
Jan 26, 2021
It's a demo and it's commented, so it seems ok. Moreover, the demo uses |
vstinner
left a comment
There was a problem hiding this comment.
Please document the incompatible change with a NEWS entry (blurb) and document in C API > Porting to Python 3.10 of:
https://docs.python.org/dev/whatsnew/3.10.html#id2
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Jan 26, 2021
@methane: Did you check for |
shihai1991
commented
Jan 26, 2021
I use https://searchcode.com/ to check who will use it. But I am not find the useful info in here. |
Uh oh!
There was an error while loading. Please reload this page.
encukou
commented
Jan 26, 2021
Well, PEP 387 is quite clear on this one, I think. |
shihai1991
commented
Jan 27, 2021
Hm, it's more friendly to users. What's your suggestion? victor :) @vstinner |
serhiy-storchaka
commented
Jan 27, 2021
Why do you want to do this? If we will do that, I think it is safe to replace an array with a structure as long as offsets of structure fields matches offsets of array items. I believe it is true on all supported platforms, because all fields are pointers. |
vstinner
commented
Jan 27, 2021
I proposed this change (and @shihai1991 implemented it) since I don't see a raw array of pointers as an "API".
Even if PyCurses_API_pointers (4) is part of the public Include/py_curses.h header file (and it doesn't exclude anything from the limited C API), it seems like the API is mostly used through these 4 macros: Not directly through Maybe this API was only exposed for the |
vstinner
commented
Jan 27, 2021
Note: Include/py_curses.h is not included by Python.h. |
vstinner
commented
Jan 27, 2021
(oops, I closed the PR by mistake.) |
This PR is stale because it has been open for 30 days with no activity. |
vstinner
commented
May 9, 2023
The capsule object and the related C API is consumed by I'm not sure what it was good idea at the beginning to make such API public. But well, when it was added 23 years ago (commit 0c7a0bd), we cared less about what should be public or private. The C API was mostly consumed by CPython itself. I suggest to make the capsule object private and move the related API to the internal C API. In Python 3.10, I directly removed the |
vstinner
commented
May 9, 2023
These APIs are not tested, not documented, and only used by
CPython: They are not used by any of the PyPI top 5000 projects. cffi has a reference but only in a comment: |
shihai1991
commented
May 11, 2023
Thanks for you comment. I am amazing that Victor checked the details again after two years :)
Maybe we can bother this PR's creator to make sure the original purpose. @akuchling I will rebase it tomorrow. |
arhadthedev
commented
May 12, 2023
Could you target |
vstinner
commented
May 12, 2023
The least risky approach is to:
|
shihai1991
commented
May 12, 2023
So 3.12 is prepare to release? I missed a lot of things recently. |
arhadthedev
commented
May 12, 2023
Moreover, its release date was moved (python/peps#3139) from this Monday to May 22. |
erlend-aasland
commented
May 13, 2023
No, only the beta (feature freeze). The release is not until this fall. Anyway, I'm not sure how PEP-387 plays with stuff that's not exposed by Python.h. |
Conflicts: Doc/whatsnew/3.10.rst Include/py_curses.h
shihai1991
commented
May 17, 2023
Hi, I updated this PR(add the internal APIs) and the old APIs in py_curses.h hasn't been removed. So I think I add a note in 3.12 will be ok? |
Probably yes, however, it's up to the core developers to decide.
@erlend-aasland Should we store the new |
shihai1991
commented
May 17, 2023
It's not common variable in interpreter(just the curses_panel extension module use this Capsule API), so saved in interpreter state is OK. |
erlend-aasland
commented
May 18, 2023
I assume you meant module state, no? |
shihai1991
commented
May 19, 2023
Oh, thanks for correcting my wrong writing. In addition, Use the |
This PR is stale because it has been open for 30 days with no activity. |
https://bugs.python.org/issue43009