pybind11/tests
Jason Rhinelander e45c211497 Support multiple inheritance from python
This commit allows multiple inheritance of pybind11 classes from
Python, e.g.

    class MyType(Base1, Base2):
        def __init__(self):
            Base1.__init__(self)
            Base2.__init__(self)

where Base1 and Base2 are pybind11-exported classes.

This requires collapsing the various builtin base objects
(pybind11_object_56, ...) introduced in 2.1 into a single
pybind11_object of a fixed size; this fixed size object allocates enough
space to contain either a simple object (one base class & small* holder
instance), or a pointer to a new allocation that can contain an
arbitrary number of base classes and holders, with holder size
unrestricted.

* "small" here means having a sizeof() of at most 2 pointers, which is
enough to fit unique_ptr (sizeof is 1 ptr) and shared_ptr (sizeof is 2
ptrs).

To minimize the performance impact, this repurposes
`internals::registered_types_py` to store a vector of pybind-registered
base types.  For direct-use pybind types (e.g. the `PyA` for a C++ `A`)
this is simply storing the same thing as before, but now in a vector;
for Python-side inherited types, the map lets us avoid having to do a
base class traversal as long as we've seen the class before.  The
change to vector is needed for multiple inheritance: Python types
inheriting from multiple registered bases have one entry per base.
2017-06-12 09:56:55 -03:00
..
test_cmake_build Replace PYBIND11_PLUGIN with PYBIND11_MODULE 2017-05-29 03:21:19 +02:00
test_embed Destroy internals if created during Py_Finalize() 2017-06-08 16:42:06 -03:00
CMakeLists.txt Add Catch framework for testing embedding support and C++-side features 2017-05-28 02:12:24 +02:00
conftest.py Minor pytest maintenance (#702) 2017-03-10 15:42:42 +01:00
constructor_stats.h Support multiple inheritance from python 2017-06-12 09:56:55 -03:00
object.h Improve custom holder support (#607) 2017-01-31 17:05:44 +01:00
pybind11_tests.cpp Replace PYBIND11_PLUGIN with PYBIND11_MODULE 2017-05-29 03:21:19 +02:00
pybind11_tests.h Replace std::cout with py::print in tests 2016-09-07 01:25:27 +02:00
pytest.ini Don't let pytest discover tests from test_cmake_build and test_embed 2017-06-10 16:44:21 +02:00
test_alias_initialization.cpp Implement py::init_alias<>() constructors 2016-09-09 03:04:09 -04:00
test_alias_initialization.py WIP: PyPy support (#527) 2016-12-16 15:00:46 +01:00
test_buffers.cpp Convenience constructor templates for buffer_info (#860) 2017-05-29 03:13:55 +02:00
test_buffers.py Fix buffer protocol inheritance 2017-05-29 02:03:58 +02:00
test_call_policies.cpp Add a scope guard call policy 2017-04-03 00:52:47 +02:00
test_call_policies.py Add a scope guard call policy 2017-04-03 00:52:47 +02:00
test_callbacks.cpp functional: support bound methods 2017-04-29 10:43:17 -04:00
test_callbacks.py functional: support bound methods 2017-04-29 10:43:17 -04:00
test_chrono.cpp Fix for floating point durations 2017-03-11 23:04:16 -04:00
test_chrono.py Fix for floating point durations 2017-03-11 23:04:16 -04:00
test_class_args.cpp Support std::shared_ptr holder type out of the box 2016-10-20 16:19:58 +02:00
test_class_args.py Set maximum line length for Python style checker (#552) 2016-12-13 00:59:28 +01:00
test_constants_and_functions.cpp Support binding noexcept function/methods in C++17 2016-12-14 20:40:49 +01:00
test_constants_and_functions.py Support binding noexcept function/methods in C++17 2016-12-14 20:40:49 +01:00
test_copy_move.cpp Enable detection of private operator new on MSVC 2017-06-08 21:54:55 +02:00
test_copy_move.py Enable detection of private operator new on MSVC 2017-06-08 21:54:55 +02:00
test_docstring_options.cpp Fix extra docstring newlines under options.disable_function_signatures() 2017-03-08 12:32:42 -05:00
test_docstring_options.py Fix extra docstring newlines under options.disable_function_signatures() 2017-03-08 12:32:42 -05:00
test_eigen.cpp Fix Eigen argument doc strings 2017-04-08 23:25:13 -04:00
test_eigen.py Fix Eigen shape assertion error in dense matrix caster 2017-05-11 16:10:40 +02:00
test_enum.cpp enum_: fix implicit conversion on Python 2.7 2017-04-29 16:35:28 +02:00
test_enum.py pytest target: add USE_TERMINAL flag 2017-04-29 16:35:28 +02:00
test_eval_call.py Add checks to maintain a consistent Python code style and prevent bugs (#515) 2016-11-20 21:21:54 +01:00
test_eval.cpp Add py::exec() as a shortcut for py::eval<py::eval_statements>() 2017-05-08 20:46:16 +02:00
test_eval.py Rewrite eval tests to allow for simple asserts 2016-08-19 16:31:48 +02:00
test_exceptions.cpp Add a method to check Python exception types (#772) 2017-04-02 22:38:50 +02:00
test_exceptions.py Add a method to check Python exception types (#772) 2017-04-02 22:38:50 +02:00
test_inheritance.cpp Make all classes with the same instance size derive from a common base 2017-02-23 15:45:26 +01:00
test_inheritance.py Make all classes with the same instance size derive from a common base 2017-02-23 15:45:26 +01:00
test_issues.cpp Enable detection of private operator new on MSVC 2017-06-08 21:54:55 +02:00
test_issues.py Move reference_wrapper test from test_issues to test_python_types 2017-05-30 13:14:49 -04:00
test_kwargs_and_defaults.cpp Add support for positional args with args/kwargs 2017-01-31 17:24:41 +01:00
test_kwargs_and_defaults.py Minor pytest maintenance (#702) 2017-03-10 15:42:42 +01:00
test_methods_and_attributes.cpp Allow py::arg().none(false) argument attribute 2017-05-24 13:10:57 -04:00
test_methods_and_attributes.py Allow py::arg().none(false) argument attribute 2017-05-24 13:10:57 -04:00
test_modules.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_modules.py Replace PYBIND11_PLUGIN with PYBIND11_MODULE 2017-05-29 03:21:19 +02:00
test_multiple_inheritance.cpp Support multiple inheritance from python 2017-06-12 09:56:55 -03:00
test_multiple_inheritance.py Support multiple inheritance from python 2017-06-12 09:56:55 -03:00
test_numpy_array.cpp Now shape, size, ndims and itemsize are also signed integers. 2017-05-08 01:50:21 +02:00
test_numpy_array.py Now shape, size, ndims and itemsize are also signed integers. 2017-05-08 01:50:21 +02:00
test_numpy_dtypes.cpp Allow std::complex field with PYBIND11_NUMPY_DTYPE (#831) 2017-05-10 11:36:24 +02:00
test_numpy_dtypes.py Allow std::complex field with PYBIND11_NUMPY_DTYPE (#831) 2017-05-10 11:36:24 +02:00
test_numpy_vectorize.cpp vectorize: pass-through of non-vectorizable args 2017-05-24 20:43:41 -04:00
test_numpy_vectorize.py vectorize: pass-through of non-vectorizable args 2017-05-24 20:43:41 -04:00
test_opaque_types.cpp Make test initialization self-registering 2016-09-03 17:34:41 -04:00
test_opaque_types.py Prefer non-converting argument overloads 2017-02-03 20:47:17 -05:00
test_operator_overloading.cpp Fix /= operator under Python 3 2017-05-21 19:15:25 -04:00
test_operator_overloading.py Fix /= operator under Python 3 2017-05-21 19:15:25 -04:00
test_pickling.cpp fix segfault in test suite due to typo (fixes #586) 2017-01-04 15:05:20 +01:00
test_pickling.py WIP: PyPy support (#527) 2016-12-16 15:00:46 +01:00
test_python_types.cpp std::reference_wrapper: non-generic types; no None 2017-05-30 13:14:49 -04:00
test_python_types.py Fix passing in utf8 encoded strings with python 2 2017-06-10 10:10:33 -04:00
test_sequences_and_iterators.cpp Add lightweight iterators for tuple, list and sequence 2017-02-26 23:57:03 +01:00
test_sequences_and_iterators.py Fix py::make_iterator's __next__() for past-the-end calls 2017-06-10 16:44:21 +02:00
test_smart_ptr.cpp Support multiple inheritance from python 2017-06-12 09:56:55 -03:00
test_smart_ptr.py Support multiple inheritance from python 2017-06-12 09:56:55 -03:00
test_stl_binders.cpp Add the buffer interface for wrapped STL vectors 2017-03-14 02:50:04 +01:00
test_stl_binders.py Fix invalid memory access in vector insert method 2017-05-25 10:51:28 -04:00
test_virtual_functions.cpp Remove obsolete comment 2017-05-02 15:21:39 -04:00
test_virtual_functions.py WIP: PyPy support (#527) 2016-12-16 15:00:46 +01:00