[weakref]How to decide whether an object is alive in python? #300
Unanswered
huangweiwu
asked this question in
Q&A
Replies: 1 comment 8 replies
-
There is an old (never merged PR due to some issues) by @hawkinsp (see #100) for enabling weak references. It's not on my priority list, so external help is welcome. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the document: bound types no longer need to be weak-referenceable, which saves a pointer per instance.
But what if I want to whether an object is alive and do something in python?
If weakref is enabled, the code below is ok. The return value of loop_func can be used to terminate the loop in C++.
Is there anyway to enable the weak-refrence.
Beta Was this translation helpful? Give feedback.
All reactions