-
Hi, Given a simple class hierarchy
and binding code
I'm getting
This only happens when both Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is a reference here that goes from a type object to an instance, which creates the potential for Nanobind instances are normally not registered with the GC, since this has a const. In this case, what I suspect is that the warning will go away if you provide at trivial |
Beta Was this translation helpful? Give feedback.
There is a reference here that goes from a type object to an instance, which creates the potential for
instance <-> type
cycles. Something like that must be happening here, which is probably complicated to understand and related to Python implementation details related to type and module objects.Nanobind instances are normally not registered with the GC, since this has a const. In this case, what I suspect is that the warning will go away if you provide at trivial
Py_tp_visit
callback that only visits the type object of the instance (see the testcases for example code). Can you try this and report back?