gh-89653: PEP 670: Limited API doesn't cast arguments (#92654)

The limited API version 3.11 no longer casts arguments to expected
types of functions of functions:

* PyList_GET_SIZE(), PyList_SET_ITEM()
* PyTuple_GET_SIZE(), PyTuple_SET_ITEM()
* PyWeakref_GET_OBJECT()
This commit is contained in:
Victor Stinner 2022-05-12 00:01:42 +02:00 committed by GitHub
parent eb88f21301
commit 7d3b469e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View file

@ -51,4 +51,6 @@ static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) {
}
return Py_None;
}
#define PyWeakref_GET_OBJECT(ref) PyWeakref_GET_OBJECT(_PyObject_CAST(ref))
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# define PyWeakref_GET_OBJECT(ref) PyWeakref_GET_OBJECT(_PyObject_CAST(ref))
#endif