pybind11/docs/advanced
jesse-sony d65edfb024
Feature/local exception translator (#2650)
* Create a module_internals struct

Since we now have two things that are going to be module local, it felt
correct to add a struct to manage them.

* Add local exception translators

These are added via the  register_local_exception_translator function
and are then applied before the global translators

* Add unit tests to show the local exception translator works

* Fix a bug in the unit test with the string value of KeyError

* Fix a formatting issue

* Rename registered_local_types_cpp()

Rename it to get_registered_local_types_cpp() to disambiguate from the
new member of module_internals

* Add additional comments to new local exception code path

* Add a register_local_exception function

* Add additional unit tests for register_local_exception

* Use get_local_internals like get_internals

* Update documentation for new local exception feature

* Add back a missing space

* Clean-up some issues in the docs

* Remove the code duplication when translating exceptions

Separated out the exception processing into a standalone function in the
details namespace.

Clean-up some comments as per PR notes as well

* Remove the code duplication in register_exception

* Cleanup some formatting things caught by clang-format

* Remove the templates from exception translators

But I added a using declaration to alias the type.

* Remove the extra local from local_internals variable names

* Add an extra explanatory comment to local_internals

* Fix a typo in the code
2021-07-21 05:22:18 -07:00
..
cast Add a std::filesystem::path <-> os.PathLike caster. (#2730) 2021-07-02 07:00:50 -07:00
pycpp docs(fix): spelling mistake in recent commit 2021-07-12 16:57:28 -04:00
classes.rst Fix typos and docs style (#3088) 2021-07-10 11:16:07 -07:00
embedding.rst refactor: module -> module_ with typedef (#2544) 2020-10-03 13:38:03 -04:00
exceptions.rst Feature/local exception translator (#2650) 2021-07-21 05:22:18 -07:00
functions.rst More precise return_value_policy::automatic documentation. (#2920) 2021-07-12 16:56:10 -07:00
misc.rst chore: drop support for PyPy < 7.3.1 and clean up old PyPy workarounds (#2456) 2020-10-05 10:43:27 -04:00
smart_ptrs.rst Replace PYBIND11_PLUGIN with PYBIND11_MODULE 2017-05-29 03:21:19 +02:00