Skip to content

Clarify reference counting part in "Thin Ice" section in extending documentation #137740

Description

@robinnarsinghranabhat

Documentation

The "Thin Ice" section in Doc/extending/extending.rst explains a potential reference counting bug but it would be nice if it clarified the underlying CPython mechanism. Especially provides nice context for people learning about cpython internals.

Proposed solution:

Add 2-3 sentences explaining the call chain from PyList_SetItem -> Py_XDECREF -> tp_dealloc -> tp_finalize, and emphasizing that it happens synchronously.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions