gh-91417: Remove PySequence_Fast() from the limited C API (#129398)

The function never worked with the limited C API. It was added by
mistake.
This commit is contained in:
Victor Stinner 2025-02-02 23:17:30 +01:00 committed by GitHub
parent ae4788809d
commit 2ad069d906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 26 deletions

View file

@ -726,31 +726,6 @@ PyAPI_FUNC(PyObject *) PySequence_Tuple(PyObject *o);
This is equivalent to the Python expression: list(o) */
PyAPI_FUNC(PyObject *) PySequence_List(PyObject *o);
/* Return the sequence 'o' as a list, unless it's already a tuple or list.
Use PySequence_Fast_GET_ITEM to access the members of this list, and
PySequence_Fast_GET_SIZE to get its length.
Returns NULL on failure. If the object does not support iteration, raises a
TypeError exception with 'm' as the message text. */
PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
/* Return the size of the sequence 'o', assuming that 'o' was returned by
PySequence_Fast and is not NULL. */
#define PySequence_Fast_GET_SIZE(o) \
(PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o))
/* Return the 'i'-th element of the sequence 'o', assuming that o was returned
by PySequence_Fast, and that i is within bounds. */
#define PySequence_Fast_GET_ITEM(o, i)\
(PyList_Check(o) ? PyList_GET_ITEM((o), (i)) : PyTuple_GET_ITEM((o), (i)))
/* Return a pointer to the underlying item array for
an object returned by PySequence_Fast */
#define PySequence_Fast_ITEMS(sf) \
(PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \
: ((PyTupleObject *)(sf))->ob_item)
/* Return the number of occurrences on value on 'o', that is, return
the number of keys for which o[key] == value.