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
For the record, Boost.Python behaves the same. Boost expects you to run n.check() before using n. Pybind instead provides py::isinstance<py::bytes>(n).
It can be considered as unexpected though. I'd vote for thinking this over, at least. I still get lost on when to use the constructor of such a subclass, or py::cast, or py::isinstance and a conversion method, or ...
Issue description
I expect something like
py::cast<py::bytes>(x)
to check if thepy::object x
is actually bytes. It does not.Reproducible example code
The text was updated successfully, but these errors were encountered: