Skip to content

Weak reference support for codon native objects #726

@lowsfer

Description

@lowsfer

I'm trying to use codon to accelerate a python project. But I wonder if there is an alternative of python weakref / C++ weak_ptr for Codon native objects. It's a resource-management components requiring weak ref for: 1. non-owning observer; 2. breaking circular reference.

Does codon support this? In my case, the weak reference is used purely internally, inside the component. And only a few specified classes needs it. In CPython, I enable weakref support by adding __weakref__ into __slots__.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions