-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Here's a minimal test-case to illustrate the issue:
struct Any {
Any(py::object & obj) {}
};
void foo (Any & obj) {}
...
py::class_<Any>(m, "Any")
.def(py::init<py::object>());
m.def("foo", &foo);
py::implicitly_convertible<py::object, Any>();
This results in:
>>> foo(123) # ok
>>> foo('') # ok
>>> foo([]) # ok
>>> foo({}) # ok
>>> foo(None)
TypeError: foo(): incompatible function arguments. The following argument types are supported:
1. (arg0: test.Any) -> None
Invoked with: None
Metadata
Metadata
Assignees
Labels
No labels