Required prerequisites
What version (or hash if on master) of pybind11 are you using?
master
Problem description
Distinct classes with the same name but in separate anonymous namespaces trigger
ImportError: generic_type: type "Foo" is already registered!
This seems to be a new behavior in the current master branch and did not happen in 2.13.6.
I came across this issue when I was preparing a PR for pybind11-stubgen to update to v3.
Reproducible example code
Register a class in two different compilation units:
namespace {
class Foo {};
}
TEST_SUBMODULE(class, m) {
py::class_<Foo>(m, "Foo");
}
Is this a regression? Put the last known working version here if it is.
This worked in v2.13.6