pybind11/include/pybind11
Dean Moldovan b4498ef44d Add py::isinstance<T>(obj) for generalized Python type checking
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
});
```
2016-11-17 08:55:42 +01:00
..
attr.h Fix dynamic attribute inheritance in C++ 2016-10-14 18:01:17 +02:00
cast.h Add py::isinstance<T>(obj) for generalized Python type checking 2016-11-17 08:55:42 +01:00
chrono.h Simplify redundant code, conform to style suggestions, improve logic 2016-09-28 01:01:44 +10:00
common.h import size_t into pybind11 namespace (fixes #498) 2016-11-15 06:37:39 +01:00
complex.h nicer type_caster::load() calling conventions 2016-05-15 20:23:27 +02:00
descr.h <optional> requires -std=c++17 (#479) 2016-11-04 14:49:37 +01:00
eigen.h Add py::isinstance<T>(obj) for generalized Python type checking 2016-11-17 08:55:42 +01:00
eval.h Python 2.7 fixes for eval() 2016-07-08 15:14:48 +02:00
functional.h more code style checks in Travis CI :) 2016-11-08 10:53:30 +01:00
numpy.h Add py::isinstance<T>(obj) for generalized Python type checking 2016-11-17 08:55:42 +01:00
operators.h Multiple inheritance support 2016-09-19 13:45:31 +02:00
options.h Provide more control over automatic generation of docstrings (#486) 2016-11-15 12:38:05 +01:00
pybind11.h exception constructor consistency improvements (fixes #492) 2016-11-16 17:59:56 +01:00
pytypes.h Add py::isinstance<T>(obj) for generalized Python type checking 2016-11-17 08:55:42 +01:00
stl_bind.h Fix stl_bind to support movable, non-copyable value types (#490) 2016-11-15 12:30:38 +01:00
stl.h Add py::isinstance<T>(obj) for generalized Python type checking 2016-11-17 08:55:42 +01:00
typeid.h minor cleanups in common.h; updated author info and copyright year 2016-04-18 10:53:38 +02:00