gh-135906: Use _PyObject_CAST in internal CPython headers#135892
gh-135906: Use _PyObject_CAST in internal CPython headers#135892ZeroIntensity merged 7 commits intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Please open an issue in this tracker. |
ZeroIntensity
left a comment
There was a problem hiding this comment.
Please also add a blurb entry, per the bot.
ZeroIntensity
left a comment
There was a problem hiding this comment.
I see some similar issues elsewhere:
cpython/Include/internal/pycore_weakref.h
Line 63 in 642e5df
cpython/Include/internal/pycore_weakref.h
Line 90 in 642e5df
Theoretically, we could test for this by including internal headers in test_cppext, but I haven't decided whether I think that's a good idea yet. I'm worried that we're going to be encouraging people to use the private API. Which APIs does Greenlet need?
Misc/NEWS.d/next/C_API/2025-06-25-01-03-10.gh-issue-135906.UBrCWq.rst
Outdated
Show resolved
Hide resolved
…CWq.rst Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This: |
|
Ok. For 3.15, please open an issue requesting that those private APIs be exposed as unstable APIs. |
They don't need to open a new issue. This is a known issue with Cython reporting it as well #130931 |
|
I would be happy to merge this (I won't block it). However, we should have some way to make sure we don't regress. |
|
I think including |
I wrote test_cppext to test the public C API (headers). Please don't include the internal C API in test_cppext, or add new tests. |
Co-authored-by: Victor Stinner <vstinner@python.org>
|
Hm, why not? Wouldn't it be easier if we were able to catch regressions immediately instead of Cython or Greenlet complaining to us later? |
|
I mean that I would prefer to leave existing test_cppext unchanged. But you can add new tests on the internal C API if you want. |
|
I wrote #136247 to test the internal C API in test_cext. So far, I failed to test the internal C API with C++, I get many compiler errors from |
|
I think we can ignore mimalloc. Nobody--even Cython--is using that with the internal headers. |
|
ZeroIntensity
left a comment
There was a problem hiding this comment.
This change on its own looks good to me. We'll figure out testing this in #136247.
|
Thanks @clin1234 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…35892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- (cherry picked from commit fe187fa) Co-authored-by: Charlie Lin <tuug@gmx.us> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
|
GH-136392 is a backport of this pull request to the 3.14 branch. |
GH-136392) gh-135906: Use `_PyObject_CAST` in internal headers (GH-135892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- (cherry picked from commit fe187fa) Co-authored-by: Charlie Lin <tuug@gmx.us> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…135892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…135892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…135892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…135892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…135892) Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build. --------- Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet against CPython 3.14.0b3 free-threaded. Resolves #135906