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

Update capi_version for mypyc tests to 3.9 #18546

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Jan 27, 2025

Followup to #18341

This PR updates the capi_version used for mypyc tests to 3.9 (mypy / mypyc requires >=3.9). For Python 3.9+ mypyc uses PyObject_VectorcallMethod instead of CPyObject_CallMethodObjArgs and select PyObject_Vectorcall where ever possible.

Will remove the now unnecessary use_method_vectorcall check in a followup.

mypy/mypyc/common.py

Lines 114 to 116 in 42e005c

def use_method_vectorcall(capi_version: tuple[int, int]) -> bool:
# We can use a dedicated vectorcall API to call methods on Python 3.9+.
return capi_version >= (3, 9)

@cdce8p cdce8p added the topic-mypyc mypyc bugs label Jan 27, 2025
@cdce8p cdce8p requested a review from JukkaL January 27, 2025 13:50
@JukkaL JukkaL merged commit dd73273 into python:master Jan 27, 2025
12 checks passed
@cdce8p cdce8p deleted the update-capi-3.9 branch January 27, 2025 16:11
JukkaL pushed a commit that referenced this pull request Jan 31, 2025
…orcall (#18548)

Followup to #18341 and #18546

We only support Python 3.9+, so `PyObject_Vectorcall` and
`PyObject_VectorcallMethod` are always available. Remove backwards
compatibility layer.
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
Followup to python#18341

This PR updates the `capi_version` used for mypyc tests to `3.9` (mypy /
mypyc requires `>=3.9`). For Python 3.9+ mypyc uses
`PyObject_VectorcallMethod` instead of `CPyObject_CallMethodObjArgs` and
select `PyObject_Vectorcall` where ever possible.

Will remove the now unnecessary `use_method_vectorcall` check in a
followup.

https://github.com/python/mypy/blob/42e005c999d8341c0da6d7b93b10d05f2db2099c/mypyc/common.py#L114-L116
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
…orcall (python#18548)

Followup to python#18341 and python#18546

We only support Python 3.9+, so `PyObject_Vectorcall` and
`PyObject_VectorcallMethod` are always available. Remove backwards
compatibility layer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-mypyc mypyc bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants