Skip to content

[C API] Add PySet_NextEntry() function #121125

Closed as not planned
Closed as not planned
@vstinner

Description

@vstinner

Feature or enhancement

The _PySet_NextEntry() function was removed in Python 3.13 alpha 1, but it's used by the Blender project: https://projects.blender.org/blender/blender/search?q=_PySet_NextEntry

I propose adding a new function to replace it:

int PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key)
  • Set *key to a strong reference, and return 1 on success.
  • Return 0 if there is no more item.
  • Set an exception and return -1 on error.

Differences with _PySet_NextEntry():

  • key is set to a strong reference, rather than a borrowed reference.
  • Remove the hash parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions