pybind11/docs/advanced
Jason Rhinelander 4b159230d9 Made module_local types take precedence over global types
Attempting to mix py::module_local and non-module_local classes results
in some unexpected/undesirable behaviour:

- if a class is registered non-local by some other module, a later
  attempt to register it locally fails.  It doesn't need to: it is
  perfectly acceptable for the local registration to simply override
  the external global registration.
- going the other way (i.e. module `A` registers a type `T` locally,
  then `B` registers the same type `T` globally) causes a more serious
  issue: `A.T`'s constructors no longer work because the `self` argument
  gets converted to a `B.T`, which then fails to resolve.

Changing the cast precedence to prefer local over global fixes this and
makes it work more consistently, regardless of module load order.
2017-08-05 11:23:34 -04:00
..
cast Add py::module_local() attribute for module-local type bindings 2017-08-04 10:47:34 -04:00
pycpp Split test_python_types.cpp into builtin_casters, stl and pytypes 2017-06-27 10:38:41 +02:00
classes.rst Made module_local types take precedence over global types 2017-08-05 11:23:34 -04:00
embedding.rst Add py::module_local() attribute for module-local type bindings 2017-08-04 10:47:34 -04:00
exceptions.rst Reorganize documentation 2016-10-20 15:21:34 +02:00
functions.rst Fix exception reference error 2017-05-26 23:20:48 -04:00
misc.rst Replace PYBIND11_PLUGIN with PYBIND11_MODULE 2017-05-29 03:21:19 +02:00
smart_ptrs.rst Replace PYBIND11_PLUGIN with PYBIND11_MODULE 2017-05-29 03:21:19 +02:00