prl-pybind11:v2.5

Last commit made on 2020-03-31
Get this branch:
git clone -b v2.5 https://git.launchpad.net/prl-pybind11

Branch merges

Branch information

Name:
v2.5
Repository:
lp:prl-pybind11

Recent commits

3b1dbeb... by Wenzel Jakob <email address hidden>

v2.5.0 release

bb9c91c... by Wenzel Jakob <email address hidden>

pybind11Tools.cmake: search for Python 3.9

4f72ef8... by Baljak <email address hidden>

Fix the use of MSVC in an MSYS environment (#2087)

e97c735... by fwjavox <email address hidden>

stl_bind: add binding for std::vector::clear (#2074)

07e2259... by Baljak <email address hidden>

Fix compilation with MinGW only (#2053)

370a2ae... by Robert Haschke <email address hidden>

Declare call_impl() as && (#2057)

bf2b031... by Wenzel Jakob <email address hidden>

Handle cases where binding code immediately throws py::error_already_set

When binding code immediately throws an exception of type
py::error_already_set (e.g. via py::module::import that fails), the
catch block sets an import error as expected. Unfortunately, following
this, the deconstructor of py::error_already_set decides to call
py::detail::get_internals() and set up various internal data structures
of pybind11, which fails given that the error flag is active. The call
stack of this looks as follows:

Py_init_mymodule() -> __cxa_decrement_exception_refcount ->
error_already_set::~error_already_set() ->
gil_scoped_acquire::gil_scoped_acquire() -> detail::get_internals() ->
... -> pybind11::detail::simple_collector() -> uh oh..

The solution is simple: we call detail::get_internals() once before
running any binding code to make sure that the internal data structures
are ready.

4c206e8... by Wenzel Jakob <email address hidden>

bindings for import_error exception

2fda9d5... by Wenzel Jakob <email address hidden>

Travis CI fix (MacOS, Py3)

f9f3bd7... by Wenzel Jakob <email address hidden>

Use C++17 fold expressions when casting tuples and argument lists (#2043)

This commit introduces the use of C++17-style fold expressions when
casting tuples & the argument lists of functions.

This change can improve performance of the resulting bindings: because
fold expressions have short-circuiting semantics, pybind11 e.g. won't
try to cast the second argument of a function if the first one failed.
This is particularly effective when working with functions that have
many overloads with long argument lists.