-
I am exploring transitioning a project from pybind11 to nanobind. However, while porting I ran into a warning from the nanobind leak detector, that I don't understand. Here is the minimal C++ example code:
When ran like this
upon exit of the interpreter I get the following warnings:
I read the section in the manual about cyclic references but I don't think these apply here. Can I ignore the warnings because they only arise because |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This can indeed be an issue in Python < 3.12 — the interpreter isn't always perfectly collecting variables in the top scope and REPL. I've found this to be more of an issue in small snippets and REPL usage as opposed to larger programs, where the logic is generally contained in functions (which don't have that issue). You can disable that warning if it bothers you, see the docs. |
Beta Was this translation helpful? Give feedback.
This can indeed be an issue in Python < 3.12 — the interpreter isn't always perfectly collecting variables in the top scope and REPL.
I've found this to be more of an issue in small snippets and REPL usage as opposed to larger programs, where the logic is generally contained in functions (which don't have that issue). You can disable that warning if it bothers you, see the docs.