-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generc_type xxxx is already registered #439
Comments
You can use |
I'll add a comment because it might be useful for future viewers. The generic type error might occur also if the same object is registered by two separated pybind11 modules. In my case I have two libraries that both need to wrap the Tabulate library. Even if internally I wrap the tabulate library with different object types, the error still persists. |
@SanPen I am facing the same issue; how have you resolved this? |
Hi! yes I solved it by adding example:
This is somewhere in the docs and should be in every example! |
Thanks a lot @SanPen ! |
Suppose in test_stl_binders.cpp we have two types mapping back to the same underlying c++ type in this case "unsigned int".
When importing the module, the error generic_type: type "AnotherVectorInt" is already registered! arises.
Are we disallowing type alias within python. Can we not refer to the same vector type using multiple python types ?
If we choose to keep the current behaviour of disallowing multiple aliases for the same underlying type we should improve the error message to say "generic_type: type "AnotherVectorInt" has underlying type "unsigned int" that is already registered.
The text was updated successfully, but these errors were encountered: