Skip to content

Refcounting changes after PEP 683 #3357

@davidhewitt

Description

@davidhewitt

PEP 683's "immortal objects" changed the meaning of reference counts; immortal objects have a fixed refcount value which never changes.

Further, the PEP states:

Py_REFCNT() - add “The refcounts 0 and 1 have specific meanings and all others only mean code somewhere is using the object, regardless of the value. 0 means the object is not used and will be cleaned up. 1 means code holds exactly a single reference.”

Does this mean that PyAny::get_refcnt should change, given that the upstream position is essentially that only 0 and 1 have meaning?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions