All Versions
30
Latest Version
Avg Release Cycle
142 days
Latest Release
56 days ago

Changelog History
Page 1

  • v3.0.4 Changes

    April 19, 2026

    🐛 Bug fixes:

    • 🛠 Fixed test builds with installed Eigen 5 by improving Eigen3 CMake package detection.
      #6036

    • Fixed move semantics of scoped_ostream_redirect to preserve buffered output and avoid crashes when moved redirects restore stream buffers.
      #6033

    • Fixed py::dynamic_attr() traversal on Python 3.13+ to correctly propagate PyObject_VisitManagedDict() results.
      #6032

    • Fixed std::shared_ptr<T> fallback casting to avoid unnecessary copy-constructor instantiation in reference_internal paths.
      #6028

    CI:

    • ⚡️ Updated setup-uv to the maintained GitHub Action tag scheme.
      #6035

    • ⚡️ Updated pre-commit hooks.
      #6029

    • ⚡️ Updated GitHub Actions dependencies, including actions-setup-cmake and cibuildwheel.
      #6027

  • v3.0.3 Changes

    March 31, 2026

    🐛 Bug fixes:

    • 🛠 Fixed TSS key exhaustion in implicitly_convertible() when many implicit conversions are registered across large module sets.
      #6020

    • 🛠 Fixed heap-buffer-overflow in pythonbuf with undersized buffers by enforcing a minimum buffer size.
      #6019

    • 🛠 Fixed virtual-inheritance pointer offset crashes when dispatching inherited methods through virtual bases.
      #6017

    • Fixed free(): invalid pointer crashes during interpreter shutdown with py::enum_<> by duplicating late-added def_property_static argument strings.
      #6015

    • Fixed function_record heap-type deallocation to call PyObject_Free() and decref the type.
      #6010

    • Hardened PYBIND11_MODULE_PYINIT and get_internals() against module-initialization crashes.
      #6018

    • Fixed static_pointer_cast build failure with virtual inheritance in holder_caster_foreign_helpers.h.
      #6014

    • 🛠 Fixed ambiguous factory template specialization that caused compilation failures with nvcc + GCC 14.
      #6011

    • 🛠 Fixed crash in def_readwrite for non-smart-holder properties of smart-holder classes.
      #6008

    • Fixed memory leak for py::dynamic_attr() objects on Python 3.13+ by clearing managed __dict__ contents during deallocation.
      #5999

    • 🛠 Fixed binding of noexcept and ref-qualified (&, &&) methods inherited from unregistered base classes.
      #5992

    Internal:

    • 🚚 Moved tomlkit dependency to the dev dependency group.
      #5990

    • Switched to newer public CPython APIs (PyType_GetFlags and public vectorcall APIs where available).
      #6005

    ✅ Tests:

    • ✅ Made an async callback test deterministic by replacing fixed sleep with bounded waiting.
      #5986

    CI:

    • ✅ Re-enabled Android tests in the cibuildwheel workflow.
      #6001
  • v3.0.2 Changes

    February 17, 2026

    🆕 New Features:

    • ➕ Added helper functions to py::array that return shape and strides as std::span when available.
      #5974

    🐛 Bug fixes:

    • ➕ Added fallback locking for Python 3.13t where PyCriticalSection_BeginMutex is unavailable.
      #5981

    • Fixed race condition in py::make_key_iterator with free-threaded Python.
      #5971

    • MSVC 19.16 and earlier were blocked from using std::launder due to internal compiler errors.
      #5968

    • ⚡️ Internals destructors were updated to check the owning interpreter before clearing Python objects.
      #5965

    • 🚀 Internals shutdown handling was refined in two iterations before release: an initial finalization-time cleanup was followed by a safety adjustment to avoid late-shutdown py::cast segfaults.
      #5958
      #5972

    • 🛠 Fixed ambiguous str(handle) construction for object-derived types like kwargs or dict by templatizing the constructor with SFINAE.
      #5949

    • Fixed concurrency consistency for internals_pp_manager under multiple-interpreters.
      #5947

    • 🛠 Fixed MSVC LNK2001 in C++20 builds when /GL (whole program optimization) is enabled.
      #5939

    • Added per-interpreter storage for gil_safe_call_once_and_store to make it safe under multi-interpreters.
      #5933

    • ↪ A workaround for a GCC -Warray-bounds false positive in argument_vector was added.
      #5908

    • Corrected a mistake where support for __index__ was added, but the type hints did not reflect acceptance of SupportsIndex objects. Also fixed a long-standing bug: the complex-caster did not accept __index__ in convert mode.
      #5891

    • Fixed *args/**kwargs return types. Added type hinting to py::make_tuple.
      #5881

    • Fixed compiler error in type_caster_generic when casting a T implicitly convertible from T*.
      #5873

    • ⚡️ Updated py::native_enum bindings to unregister enum types on destruction, preventing a use-after-free when returning a destroyed enum instance.
      #5871

    • 🛠 Fixed undefined behavior that occurred when importing pybind11 modules from non-main threads created by C API modules or embedded python interpreters.
      #5870

    • Fixed dangling pointer in internals::registered_types_cpp_fast.
      #5867

    • ➕ Added support for std::shared_ptr<T> when loading module-local or conduit types from other modules.
      #5862

    • Fixed thread-safety issues if types were concurrently registered while get_local_type_info() was called in free threaded Python.
      #5856

    • Fixed py::float_ casting and py::int_ and py::float_ type hints.
      #5839

    • Fixed two smart_holder bugs in shared_ptr and unique_ptr adoption with multiple/virtual inheritance:

    • Constrained accessor::operator= templates to avoid obscuring special members.
      #5832

    • 🛠 Fixed crash that can occur when finalizers acquire and release the GIL.
      #5828

    • Fixed compiler detection in pybind11/detail/pybind11_namespace_macros.h for clang-cl on Windows, to address warning suppression macros.
      #5816

    • 🛠 Fixed compatibility with CMake policy CMP0190 by not always requiring a Python interpreter when cross-compiling.
      #5829

    • Added a static assertion to disallow keep_alive and call_guard on properties.
      #5533

    Internal:

    • CMake policy limit was set to 4.1.
      #5944

    • 👌 Improved performance of function calls between Python and C++ by switching to the "vectorcall" calling protocol.
      #5948

    • 💅 Many C-style casts were replaced with C++-style casts.
      #5930

    • Added cast_sources abstraction to type_caster_generic.
      #5866

    • 👌 Improved the performance of from-Python conversions of legacy pybind11 enum objects bound by py::enum_.
      #5860

    • ⬇️ Reduced size overhead by deduplicating functions' readable signatures and type information.
      #5857

    • 👉 Used new Python 3.14 C APIs when available.
      #5854

    • 👌 Improved performance of function dispatch and type casting by porting two-level type info lookup strategy from nanobind.
      #5842

    • Updated .gitignore to exclude __pycache__ / directories.
      #5838

    • Changed internals to use thread_local instead of thread_specific_storage for increased performance.
      #5834

    • Reduced function call overhead by using thread_local for loader_life_support when possible.
      #5830

    • ✂ Removed heap allocation for the C++ argument array when dispatching functions with 6 or fewer arguments.
      #5824

    📚 Documentation:

    • 🛠 Fixed docstring for long double complex types to use numpy.clongdouble instead of the deprecated numpy.longcomplex (removed in NumPy 2.0).
      #5952

    • 👷 The "Supported compilers" and "Supported platforms" sections in the main README.rst were replaced with a new "Supported platforms & compilers" section that points to the CI test matrix as the living source of truth.
      #5910

    • 🛠 Fixed documentation formatting.
      #5903

    • ⚡️ Updated upgrade notes for py::native_enum.
      #5885

    • 📄 Clarified in the docs to what extent bindings are global.
      #5859

    ✅ Tests:

    • 🛠 Fixed deadlock in a free-threading test by releasing the GIL while waiting on synchronization.
      #5973

    • ✅ Calls to env.deprecated_call() were replaced with direct calls to pytest.deprecated_call().
      #5893

    • 🌲 Updated pytest configuration to use log_level instead of log_cli_level.
      #5890

    CI:

    • ➕ Added CI tests for windows-11-arm with clang/MSVC (currently python 3.13), windows-11-arm with clang/mingw (currently python 3.12).
      #5932

    • These clang-tidy rules were added: readability-redundant-casting, readability-redundant-inline-specifier, readability-redundant-member-init
      #5924

    • 🍎 Replaced deprecated macos-13 runners with macos-15-intel in CI.
      #5916

    • 🏁 Restored runs-on: windows-latest in CI.
      #5835

  • v3.0.1 Changes

    August 22, 2025

    🐛 Bug fixes:

    • Fixed compilation error in type_caster_enum_type when casting pointer-to-enum types. Added pointer overload to handle dereferencing before enum conversion. #5776
    • Implement binary version of make_index_sequence to reduce template depth requirements for functions with many parameters. #5751
    • 🚚 Subinterpreter-specific exception handling code was removed to resolve segfaults. #5795
    • 🛠 Fixed issue that caused PYBIND11_MODULE code to run again if the module was re-imported after being deleted from sys.modules. #5782
    • ↪ Prevent concurrent creation of sub-interpreters as a workaround for stdlib concurrency issues in Python 3.12. #5779
    • 🛠 Fixed potential crash when using cpp_function objects with sub-interpreters. #5771
    • 🛠 Fixed non-entrant check in implicitly_convertible(). #5777
    • 👌 Support C++20 on platforms that have older c++ runtimes. #5761
    • 🛠 Fix compilation with clang on msys2. #5757
    • ⚠ Avoid nullptr dereference warning with GCC 13.3.0 and python 3.11.13. #5756
    • 🛠 Fix potential warning about number of threads being too large. #5807

    • 🛠 Fix gcc 11.4+ warning about serial compilation using CMake. #5791

    📚 Documentation:

    • 👌 Improve buffer_info type checking in numpy docs. #5805
    • 🏗 Replace robotpy-build with semiwrap in the binding tool list. #5804
    • 👉 Show nogil in most examples. #5770
    • Fix py::trampoline_self_life_support visibility in docs. #5766

    ✅ Tests:

    • ⚠ Avoid a spurious warning about DOWNLOAD_CATCH being manually specified. #5803
    • 🛠 Fix an IsolatedConfig test. #5768

    CI:

    • ➕ Add CI testing for Android. #5714

    Internal:

    • 📇 Rename internal variables to avoid the word slots (reads better). #5793
  • v3.0.0 Changes

    July 10, 2025

    🚀 Pybind11 3.0 includes an ABI bump, the first required bump in many years on Unix (Windows has had required bumps more often). This release contains the smart-holder branch, multi-phase init and subinterpreter support, py::native_enum, an interface to warnings, typing improvements, and more. CMake now defaults to FindPython mode. Please check our upgrade guide for more info on upgrading!

    👌 Support for Python 3.14, 3.14t, GraalPy, and PyPy 3.11 has been added, while legacy support for Python 3.7, PyPy 3.8/3.9, and CMake <3.15 has been removed. Most deprecated features have been kept for this release, but anything producing a warning in 3.0 may be removed in a future 3.x version. We also now have a deprecation page.

    🆕 New Features:

    • 🔀 The smart_holder branch has been merged, enabling py::class_<T, py::smart_holder>, which handles two-way conversion with std::unique_ptr<T> and std::shared_ptr<T> (simultaneously), disowning a Python object being passed to std::unique_ptr<T>, trampoline objects, and std::enable_shared_from_this. #5542

    • 🔄 Changed PYBIND11_MODULE macro implementation to perform multi-phase module initialization (PEP 489) behind the scenes. #5574 and avoid destruction #5688

    • Support for sub-interpreters (both isolated (with separate GILs) and legacy (with a global GIL). Add the py::multiple_interpreters::per_interpreter_gil() tag (or, py::multiple_interpreters::shared_gil() for legacy interpreter support) to PYBIND11_MODULE calls (as the third parameter) to indicate that a module supports running with sub-interpreters. #5564

    • Changed PYBIND11_EMBEDDED_MODULE macro implementation to perform multi-phase module initialization (PEP 489) behind the scenes and to support py::mod_gil_not_used(), py::multiple_interpreters::per_interpreter_gil() and py::multiple_interpreters::shared_gil(). #5665 and consolidate code #5670

    • ➕ Added API in pybind11/subinterpreter.h for embedding sub-intepreters (requires Python 3.12+). #5666

    • py::native_enum was added, for conversions between Python's native (stdlib) enum types and C++ enums. #5555

    • Support py::numpy_scalar<> / py::make_scalar() for NumPy types. #5726

    • A py::release_gil_before_calling_cpp_dtor option (for py::class_) was added to resolve the long-standing issue #1446. #5522

    • Add dtype::normalized_num and dtype::num_of. #5429

    • Add support for array_t<handle> and array_t<object>. #5427

    • ⚠ Added py::warnings namespace with py::warnings::warn and py::warnings::new_warning_type that provides the interface for Python warnings. #5291

    • stl.h list|set|map_caster were made more user friendly: it is no longer necessary to explicitly convert Python iterables to tuple(), set(), or map() in many common situations. #4686

    • 0️⃣ The array_caster in pybind11/stl.h was enhanced to support value types that are not default-constructible. #5305

    • pybind11/conduit/pybind11_platform_abi_id.h was factored out, to maximize reusability of PYBIND11_PLATFORM_ABI_ID (for other Python/C++ binding systems). Separately, a note was added to explain that the conduit feature only covers from-Python-to-C++ conversions. #5375 | #5740

    • ➕ Added support for finding pybind11 using pkgconf distributed on pypi. #5552

    • 👌 Support --extension-suffix on the pybind11 command. #5360

    • Add semi-public API: pybind11::detail::is_holder_constructed and update example for pybind11::custom_type_setup in documentation. #5669

    • 🚑 Added py::scoped_critical_section to support free-threaded mode. #5684 | #5706

    🆕 New Features / fixes (typing):

    • ➕ Added option for different arg/return type hints to type_caster. Updated stl/filesystem to use correct arg/return type hints. Updated pybind11::typing to use correct arg/return type hints for nested types. #5450

    • ⚡️ Updated type hint for py::capsule to type.CapsuleType. #5567

    • Adds support for typing.SupportsInt and typing.SupportsFloat. Update Final to be narrower type hint. Make std::function match Callable type. Fix io_name bug in attr_with_type_hint. #5540

    • 👍 Rework of arg/return type hints to support .noconvert(). #5486

    • Add attr_with_type for declaring attribute types and Final, ClassVar type annotations. #5460

    • 👍 Allow annotate methods with py::pos_only when only have the self argument. Make arguments for auto-generated dunder methods positional-only. #5403

    • Added py::Args and py::KWArgs to enable custom type hinting of *args and **kwargs (see PEP 484). #5357

    • Switched to numpy.typing.NDArray and numpy.typing.ArrayLike. #5212

    • 👉 Use numpy.object_ instead of object. #5571

    • 🛠 Fix module type hint. #5469

    • 🛠 Fix Buffer type hint. #5662

    • ➕ Added support for collections.abc in type hints and convertible checks of STL casters and py::buffer. #5566

    • 🛠 Fix typing and collections.abc type hint ambiguity. #5663

    • ➕ Add typing_extensions alternatives for all types that need them. #5693

    Removals:

    • ✂ Remove support for pybind11 v2 internals versions (4, 5, 6). (The internals version number has been bumped for pybind11 v3.) #5512 | #5530

    • Remove make_simple_namespace (added in 2.8.0, deprecated in 2.8.1). #5597

    • Legacy-mode option PYBIND11_NUMPY_1_ONLY has been removed. #5595

    • ➕ Add a deprecation warning to .get_type (deprecated in pybind11 2.6 in 2020). #5596

    🐛 Bug fixes:

    • Set __file__ on submodules. #5584. Except on embedded modules. #5650

    • pybind11-bound functions are now pickleable. #5580

    • Fix bug in attr_with_type_hint to allow objects to be in attr_with_type_hint. #5576

    • ⚠ A -Wmaybe-uninitialized warning suppression was added in pybind11/eigen/matrix.h. #5516

    • PYBIND11_WARNING_POP was incorrectly defined as PYBIND11_PRAGMA(clang diagnostic push). #5448

    • PYBIND11_PLATFORM_ABI_ID (which is used in composing PYBIND11_INTERNALS_ID) was modernized to reflect actual ABI compatibility more accurately. #4953 | [#5439](https://github.com...

  • v2.13.6 Changes

    September 14, 2024

    🆕 New Features:

    • A new self._pybind11_conduit_v1_() method is automatically added to all py::class_-wrapped types, to enable type-safe interoperability between different independent Python/C++ bindings systems, including pybind11 versions with different PYBIND11_INTERNALS_VERSION's. Supported on pybind11 2.11.2, 2.12.1, and 2.13.6+. #5296

    🐛 Bug fixes:

    • Using __cpp_nontype_template_args instead of __ cpp_nontype_template_parameter_class. #5330
    • 👻 Properly translate C++ exception to Python exception when creating Python buffer from wrapped object. #5324

    📚 Documentation:

    • ➕ Adds an answer (FAQ) for "What is a highly conclusive and simple way to find memory leaks?". #5340
  • v2.13.5 Changes

    August 22, 2024

    🐛 Bug fixes:

    • 🛠 Fix includes when using Windows long paths (\\?\ prefix). #5321
    • 👌 Support -Wpedantic in C++20 mode. #5322
    • 🛠 Fix and test <ranges> support for py::tuple and py::list. #5314
  • v2.12.1 Changes

    September 13, 2024

    🆕 New Features:

    • A new self._pybind11_conduit_v1_() method is automatically added to all py::class_-wrapped types, to enable type-safe interoperability between different independent Python/C++ bindings systems, including pybind11 versions with different PYBIND11_INTERNALS_VERSION's. Supported on pybind11 2.11.2, 2.12.1, and 2.13.6+. #5296
  • v2.11.2 Changes

    September 13, 2024

    🆕 New Features:

    • A new self._pybind11_conduit_v1_() method is automatically added to all py::class_-wrapped types, to enable type-safe interoperability between different independent Python/C++ bindings systems, including pybind11 versions with different PYBIND11_INTERNALS_VERSION's. Supported on pybind11 2.11.2, 2.12.1, and 2.13.6+. #5296
  • v2.6.1 Changes

    November 12, 2020
    • py::exec, py::eval, and py::eval_file now add the builtins module as " __builtins__" to their globals argument, better matching exec and eval in pure Python. #2616
    • 🍎 setup_helpers will no longer set a minimum macOS version higher than the current version. #2622
    • 👍 Allow deleting static properties. #2629
    • Seal a leak in def_buffer, cleaning up the capture object after the class_ object goes out of scope.
      #2634
    • pybind11_INCLUDE_DIRS was incorrect, potentially causing a regression if it was expected to include PYTHON_INCLUDE_DIRS (please use targets instead). #2636
    • ➕ Added parameter names to the py::enum_ constructor and methods, avoiding arg0 in the generated docstrings. #2637
    • ➕ Added needs_recompile optional function to the ParallelCompiler helper, to allow a recompile to be skipped based on a user-defined function. #2643