Non-literal default argument interferes with module locality #5064
Unanswered
cnx-tcsikos
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi All!
I'm experiencing an issue with default arguments, where even though
std::vector<uint8_t>
is defined withpy::module_local()
, its definitions in the two modules conflicts with the following error:ImportError: generic_type: type "vector_uint8_t" is already registered!
This only happens if default argument is a non-literal value. If
py::arg("a") = std::vector<uint8_t>(1,2,3,4)
, everything works.Consider the following setup:
lib_dep.cpp
lib_super
Beta Was this translation helpful? Give feedback.
All reactions