Skip to content

Unclear lifetimes of borrowed references #5

Open
@encukou

Description

@encukou

Lots of functions return borrowed references, but in many cases it's not clear what's lending the reference, and how to ensure that lender keeps the reference alive as long as necessary.

For example, PyList_GetItem is very tricky to use 100% correctly -- it's relatively obvious that the list is the lender (so you need to keep it around), but it's not obvious that arbitrary Python code (like a finalizer) could clear the list and drop the reference.

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