Closed
Description
When a class with an overloaded copy constructor:
struct Bla {
Bla() = default;
explicit Bla(const Bla &, bool deep=true) { }
explicit Bla(const Bla &, int i, std::string s="", bool deep=true) { }
};
wrapped as
py::class_<Bla>(m, "Bla")
.def(py::init<>())
.def(py::init<const Bla &, bool>(),
"other"_a, "deep"_a=true)
.def(py::init<const Bla &, int, std::string, bool>(),
"other"_a, "i"_a, "s"_a="", "deep"_a=true);
Is called with:
b = Bla()
c = Bla(b, 1, deep=False)
The error message reads: TypeError: __init__(): got multiple values for argument 'deep'
. Which is confusing.
Metadata
Metadata
Assignees
Labels
No labels