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

Add vector call functions to the limited API #98586

Closed
wjakob opened this issue Oct 24, 2022 · 1 comment · Fixed by #98587
Closed

Add vector call functions to the limited API #98586

wjakob opened this issue Oct 24, 2022 · 1 comment · Fixed by #98587
Labels
topic-C-API type-feature A feature request or enhancement

Comments

@wjakob
Copy link
Contributor

wjakob commented Oct 24, 2022

Feature or enhancement

Starting in Python 3.12, it is possible to receive vector calls in the limited API. However, it is not possible to issue them from a binary extension module compiled for the limited API.

Pitch

Since the PEP-590 is presumably stable at this point, I propose exposing more of it through the limited API. This would entail the functions

  • PyObject_Vectorcall
  • PyObject_VectorcallMethod
  • PyObject_VectorcallDict
  • PY_VECTORCALL_ARGUMENTS_OFFSET (a macro constant that is needed to use these effectively)

Previous discussion

Some related discussion took place here: https://discuss.python.org/t/ideas-for-forward-compatible-and-fast-extension-libraries-in-python-3-12. This PR Is specifically about item #5 from the list in the first post.

@wjakob wjakob added the type-feature A feature request or enhancement label Oct 24, 2022
@wjakob
Copy link
Contributor Author

wjakob commented Oct 24, 2022

PR #98587 contains a tentative set of changes realizing the addition of these functions.

@erlend-aasland erlend-aasland linked a pull request Oct 24, 2022 that will close this issue
encukou pushed a commit that referenced this issue Oct 27, 2022
Expose the facilities for making vector calls through Python's limited API.
gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue Oct 28, 2022
Expose the facilities for making vector calls through Python's limited API.
wjakob added a commit to wjakob/cpython that referenced this issue Nov 3, 2022
PR python#98587 addressing issue python#98586 lacked a "what's new" entry.

While making those changes, I noticed an inconsistency in how
``PY_VECTORCALL_ARGUMENTS_OFFSET`` is declared in the underlying Sphinx
markup when compared to other macro constants like
``Py_TPFLAGS_HAVE_VECTORCALL``. This PR fixes that as well, which should
connect a few currently broken cross-references
erlend-aasland added a commit that referenced this issue Nov 6, 2022
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-C-API type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants