Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AddPyList_GetItemRef, a variant ofPyList_GetItem that returns a strong reference #114329

Closed
@colesbury

Description

@colesbury

Feature or enhancement

The free-threaded builds need a variant ofPyList_GetItem that returns a strong reference instead of a borrowed reference for thread-safety reasons. PEP 703 proposedPyList_FetchItem, but since thenPyDict_GetItemRef and functions with similar signatures have been added.

This proposesPyList_GetItemRef with the following signature:

PyObject *PyList_GetItemRef(PyObject *list, Py_ssize_t index)

Return astrong reference to the object at position index in the list pointed to by list. Ifindex is out of bounds (<0 or >=len(list)), return NULL and set an IndexError. Iflist is not a list instance, return NULL and set a TypeError.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp