Skip to content

Remove broken PySequence_Fast() function from the limited C API #55

Closed
@vstinner

Description

@vstinner

The limited C API has the function PySequence_Fast() which should be used with these macros:

  • PySequence_Fast_GET_SIZE()
  • PySequence_Fast_GET_ITEM()
  • PySequence_Fast_ITEMS()

Problem: none of these 3 macros work with the limited C API. The whole PySequence_Fast() API is broken in the limited C API.

Example:

#define PySequence_Fast_GET_ITEM(o, i)\
     (PyList_Check(o) ? PyList_GET_ITEM((o), (i)) : PyTuple_GET_ITEM((o), (i)))

PyList_GET_ITEM() and PyTuple_GET_ITEM() are not part of the limited C API, so PySequence_Fast_GET_ITEM() cannot be used in the limited C API.

I propose to remove PySequence_Fast() and these 3 macros from the limited C API, since they are incompatible and never worked with the limited C API.

Vote:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions