Skip to content

generc_type xxxx is already registered #439

Closed
@kanaero

Description

@kanaero

Suppose in test_stl_binders.cpp we have two types mapping back to the same underlying c++ type in this case "unsigned int".

py::bind_vector<std::vector<unsigned int>>(global, "VectorInt");
py::bind_vector<std::vector<unsigned int>>(global, "AnotherVectorInt");

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions