github pybind/pybind11 v2.6.2
Version 2.6.2

latest releases: v2.12.0, v2.11.1, v2.11.0...
3 years ago

Minor missing functionality added:

  • enum: add missing Enum.value property. #2739
  • Allow thread termination to be avoided during shutdown for CPython 3.7+ via .disarm for gil_scoped_acquire/gil_scoped_release. #2657

Fixed or improved behavior in a few special cases:

  • Fix bug where the constructor of object subclasses would not throw on being passed a Python object of the wrong type. #2701
  • The type_caster for integers does not convert Python objects with __int__ anymore with noconvert or during the first round of trying overloads. #2698
  • When casting to a C++ integer, __index__ is always called and not considered as conversion, consistent with Python 3.8+. #2801

Build improvements:

  • Setup helpers: extra_compile_args and extra_link_args automatically set by Pybind11Extension are now prepended, which allows them to be overridden by user-set extra_compile_args and extra_link_args. #2808
  • Setup helpers: Don't trigger unused parameter warning. #2735
  • CMake: Support running with --warn-uninitialized active. #2806
  • CMake: Avoid error if included from two submodule directories. #2804
  • CMake: Fix STATIC / SHARED being ignored in FindPython mode. #2796
  • CMake: Respect the setting for CMAKE_CXX_VISIBILITY_PRESET if defined. #2793
  • CMake: Fix issue with FindPython2/FindPython3 not working with pybind11::embed. #2662
  • CMake: mixing local and installed pybind11's would prioritize the installed one over the local one (regression in 2.6.0). #2716

Bug fixes:

  • Fixed segfault in multithreaded environments when using scoped_ostream_redirect. #2675
  • Leave docstring unset when all docstring-related options are disabled, rather than set an empty string. #2745
  • The module key in builtins that pybind11 uses to store its internals changed from std::string to a python str type (more natural on Python 2, no change on Python 3). #2814
  • Fixed assertion error related to unhandled (later overwritten) exception in CPython 3.8 and 3.9 debug builds. #2685
  • Fix py::gil_scoped_acquire assert with CPython 3.9 debug build. #2683
  • Fix issue with a test failing on PyTest 6.2. #2741

Warning fixes:

  • Fix warning modifying constructor parameter 'flag' that shadows a field of 'set_flag' [-Wshadow-field-in-constructor-modified]. #2780
  • Suppressed some deprecation warnings about old-style __init__/__setstate__ in the tests. #2759

Valgrind work:

  • Fix invalid access when calling a pybind11 __init__ on a non-pybind11 class instance. #2755
  • Fixed various minor memory leaks in pybind11's test suite. #2758
  • Resolved memory leak in cpp_function initialization when exceptions occurred. #2756
  • Added a Valgrind build, checking for leaks and memory-related UB, to CI. #2746

Compiler support:

  • Intel compiler was not activating C++14 support due to a broken define. #2679
  • Support ICC and NVIDIA HPC SDK in C++17 mode. #2729
  • Support Intel OneAPI compiler (ICC 20.2) and add to CI. #2573

Don't miss a new pybind11 release

NewReleases is sending notifications on new releases.