You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In pybind 2.2.3, the template specialization py::isinstance<py::str>() returns True when used on py::bytes objects. This is incorrect in both Py2 and 3 (since py::str is unicode in Py2).
py::instance(obj, py::str().get_type()) works correctly.
Reproducible example code
m.def("test_isinstance",
[]() {
py::bytes b = "123";
py::print(py::isinstance<py::str>(b));
}
);