| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| attr.h | ||
| cast.h | ||
| chrono.h | ||
| common.h | ||
| complex.h | ||
| descr.h | ||
| eigen.h | ||
| eval.h | ||
| functional.h | ||
| numpy.h | ||
| operators.h | ||
| options.h | ||
| pybind11.h | ||
| pytypes.h | ||
| stl.h | ||
| stl_bind.h | ||
| typeid.h |
Allows checking the Python types before creating an object instead of
after. For example:
```c++
auto l = list(ptr, true);
if (l.check())
// ...
```
The above is replaced with:
```c++
if (isinstance<list>(ptr)) {
auto l = reinterpret_borrow(ptr);
// ...
}
```
This deprecates `py::object::check()`. `py::isinstance()` covers the
same use case, but it can also check for user-defined types:
```c++
class Pet { ... };
py::class_<Pet>(...);
m.def("is_pet", [](py::object obj) {
return py::isinstance<Pet>(obj); // works as expected
});
```
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| attr.h | Loading commit data... | |
| cast.h | Loading commit data... | |
| chrono.h | Loading commit data... | |
| common.h | Loading commit data... | |
| complex.h | Loading commit data... | |
| descr.h | Loading commit data... | |
| eigen.h | Loading commit data... | |
| eval.h | Loading commit data... | |
| functional.h | Loading commit data... | |
| numpy.h | Loading commit data... | |
| operators.h | Loading commit data... | |
| options.h | Loading commit data... | |
| pybind11.h | Loading commit data... | |
| pytypes.h | Loading commit data... | |
| stl.h | Loading commit data... | |
| stl_bind.h | Loading commit data... | |
| typeid.h | Loading commit data... |