Changelog History
Page 1
-
v3.0.4 Changes
April 19, 2026🐛 Bug fixes:
🛠 Fixed test builds with installed Eigen 5 by improving
Eigen3CMake package detection.
#6036Fixed move semantics of
scoped_ostream_redirectto preserve buffered output and avoid crashes when moved redirects restore stream buffers.
#6033Fixed
py::dynamic_attr()traversal on Python 3.13+ to correctly propagatePyObject_VisitManagedDict()results.
#6032Fixed
std::shared_ptr<T>fallback casting to avoid unnecessary copy-constructor instantiation inreference_internalpaths.
#6028
CI:
-
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
pythonbufwith undersized buffers by enforcing a minimum buffer size.
#6019🛠 Fixed virtual-inheritance pointer offset crashes when dispatching inherited methods through virtual bases.
#6017Fixed
free(): invalid pointercrashes during interpreter shutdown withpy::enum_<>by duplicating late-addeddef_property_staticargument strings.
#6015Fixed
function_recordheap-type deallocation to callPyObject_Free()and decref the type.
#6010Hardened
PYBIND11_MODULE_PYINITandget_internals()against module-initialization crashes.
#6018Fixed
static_pointer_castbuild failure with virtual inheritance inholder_caster_foreign_helpers.h.
#6014🛠 Fixed ambiguous
factorytemplate specialization that caused compilation failures with nvcc + GCC 14.
#6011🛠 Fixed crash in
def_readwritefor non-smart-holder properties of smart-holder classes.
#6008Fixed memory leak for
py::dynamic_attr()objects on Python 3.13+ by clearing managed__dict__contents during deallocation.
#5999🛠 Fixed binding of
noexceptand ref-qualified (&,&&) methods inherited from unregistered base classes.
#5992
Internal:
🚚 Moved
tomlkitdependency to the dev dependency group.
#5990Switched to newer public CPython APIs (
PyType_GetFlagsand 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::arraythat return shape and strides asstd::spanwhen available.
#5974
🐛 Bug fixes:
➕ Added fallback locking for Python 3.13t where
PyCriticalSection_BeginMutexis unavailable.
#5981Fixed race condition in
py::make_key_iteratorwith free-threaded Python.
#5971MSVC 19.16 and earlier were blocked from using
std::launderdue 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::castsegfaults.
#5958
#5972🛠 Fixed ambiguous
str(handle)construction forobject-derived types likekwargsordictby templatizing the constructor with SFINAE.
#5949Fixed concurrency consistency for
internals_pp_managerunder multiple-interpreters.
#5947🛠 Fixed MSVC LNK2001 in C++20 builds when /GL (whole program optimization) is enabled.
#5939Added per-interpreter storage for
gil_safe_call_once_and_storeto make it safe under multi-interpreters.
#5933↪ A workaround for a GCC
-Warray-boundsfalse positive inargument_vectorwas added.
#5908Corrected a mistake where support for
__index__was added, but the type hints did not reflect acceptance ofSupportsIndexobjects. Also fixed a long-standing bug: the complex-caster did not accept__index__inconvertmode.
#5891Fixed
*args/**kwargsreturn types. Added type hinting topy::make_tuple.
#5881Fixed compiler error in
type_caster_genericwhen casting aTimplicitly convertible fromT*.
#5873⚡️ Updated
py::native_enumbindings 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.
#5870Fixed 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.
#5862Fixed thread-safety issues if types were concurrently registered while
get_local_type_info()was called in free threaded Python.
#5856Fixed py::float_ casting and py::int_ and py::float_ type hints.
#5839Fixed two
smart_holderbugs inshared_ptrandunique_ptradoption 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.
#5828Fixed compiler detection in
pybind11/detail/pybind11_namespace_macros.hfor 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.
#5829Added a static assertion to disallow
keep_aliveandcall_guardon 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.
#5930Added
cast_sourcesabstraction totype_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.
#5842Updated
.gitignoreto exclude__pycache__ /directories.
#5838Changed internals to use
thread_localinstead ofthread_specific_storagefor increased performance.
#5834Reduced 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 doublecomplex types to usenumpy.clongdoubleinstead of the deprecatednumpy.longcomplex(removed in NumPy 2.0).
#5952👷 The "Supported compilers" and "Supported platforms" sections in the main
README.rstwere 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 topytest.deprecated_call().
#5893🌲 Updated pytest configuration to use
log_levelinstead oflog_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).
#5932These 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-latestin CI.
#5835
- ➕ Added helper functions to
-
v3.0.1 Changes
August 22, 2025🐛 Bug fixes:
- Fixed compilation error in
type_caster_enum_typewhen casting pointer-to-enum types. Added pointer overload to handle dereferencing before enum conversion. #5776 - Implement binary version of
make_index_sequenceto 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_MODULEcode to run again if the module was re-imported after being deleted fromsys.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_functionobjects 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
nullptrdereference 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_infotype checking in numpy docs. #5805 - 🏗 Replace
robotpy-buildwithsemiwrapin the binding tool list. #5804 - 👉 Show nogil in most examples. #5770
- Fix
py::trampoline_self_life_supportvisibility in docs. #5766
✅ Tests:
- ⚠ Avoid a spurious warning about
DOWNLOAD_CATCHbeing 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
- Fixed compilation error in
-
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_holderbranch has been merged, enablingpy::class_<T, py::smart_holder>, which handles two-way conversion withstd::unique_ptr<T>andstd::shared_ptr<T>(simultaneously), disowning a Python object being passed tostd::unique_ptr<T>, trampoline objects, andstd::enable_shared_from_this. #5542🔄 Changed
PYBIND11_MODULEmacro implementation to perform multi-phase module initialization (PEP 489) behind the scenes. #5574 and avoid destruction #5688Support 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) toPYBIND11_MODULEcalls (as the third parameter) to indicate that a module supports running with sub-interpreters. #5564Changed
PYBIND11_EMBEDDED_MODULEmacro implementation to perform multi-phase module initialization (PEP 489) behind the scenes and to supportpy::mod_gil_not_used(),py::multiple_interpreters::per_interpreter_gil()andpy::multiple_interpreters::shared_gil(). #5665 and consolidate code #5670➕ Added API in
pybind11/subinterpreter.hfor embedding sub-intepreters (requires Python 3.12+). #5666py::native_enumwas added, for conversions between Python's native (stdlib) enum types and C++ enums. #5555Support
py::numpy_scalar<>/py::make_scalar()for NumPy types. #5726A
py::release_gil_before_calling_cpp_dtoroption (forpy::class_) was added to resolve the long-standing issue #1446. #5522Add
dtype::normalized_numanddtype::num_of. #5429Add support for
array_t<handle>andarray_t<object>. #5427⚠ Added
py::warningsnamespace withpy::warnings::warnandpy::warnings::new_warning_typethat provides the interface for Python warnings. #5291stl.hlist|set|map_casterwere made more user friendly: it is no longer necessary to explicitly convert Python iterables totuple(),set(), ormap()in many common situations. #46860️⃣ The
array_casterin pybind11/stl.h was enhanced to support value types that are not default-constructible. #5305pybind11/conduit/pybind11_platform_abi_id.hwas factored out, to maximize reusability ofPYBIND11_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-suffixon the pybind11 command. #5360Add semi-public API:
pybind11::detail::is_holder_constructedand update example forpybind11::custom_type_setupin documentation. #5669🚑 Added
py::scoped_critical_sectionto support free-threaded mode. #5684 | #5706
🆕 New Features / fixes (typing):
➕ Added option for different arg/return type hints to
type_caster. Updatedstl/filesystemto use correct arg/return type hints. Updatedpybind11::typingto use correct arg/return type hints for nested types. #5450⚡️ Updated type hint for
py::capsuletotype.CapsuleType. #5567Adds support for
typing.SupportsIntandtyping.SupportsFloat. UpdateFinalto be narrower type hint. Makestd::functionmatchCallabletype. Fixio_namebug inattr_with_type_hint. #5540👍 Rework of arg/return type hints to support
.noconvert(). #5486Add
attr_with_typefor declaring attribute types andFinal,ClassVartype annotations. #5460👍 Allow annotate methods with
py::pos_onlywhen only have theselfargument. Make arguments for auto-generated dunder methods positional-only. #5403Added
py::Argsandpy::KWArgsto enable custom type hinting of*argsand**kwargs(see PEP 484). #5357Switched to
numpy.typing.NDArrayandnumpy.typing.ArrayLike. #5212👉 Use
numpy.object_instead ofobject. #5571🛠 Fix module type hint. #5469
🛠 Fix Buffer type hint. #5662
➕ Added support for
collections.abcin type hints and convertible checks of STL casters andpy::buffer. #5566🛠 Fix
typingandcollections.abctype hint ambiguity. #5663➕ Add
typing_extensionsalternatives 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). #5597Legacy-mode option
PYBIND11_NUMPY_1_ONLYhas 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. #5650pybind11-bound functions are now pickleable. #5580
Fix bug in
attr_with_type_hintto allow objects to be inattr_with_type_hint. #5576⚠ A
-Wmaybe-uninitializedwarning suppression was added inpybind11/eigen/matrix.h. #5516⚠
PYBIND11_WARNING_POPwas incorrectly defined asPYBIND11_PRAGMA(clang diagnostic push). #5448PYBIND11_PLATFORM_ABI_ID(which is used in composingPYBIND11_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 allpy::class_-wrapped types, to enable type-safe interoperability between different independent Python/C++ bindings systems, including pybind11 versions with differentPYBIND11_INTERNALS_VERSION's. Supported on pybind11 2.11.2, 2.12.1, and 2.13.6+. #5296
🐛 Bug fixes:
- Using
__cpp_nontype_template_argsinstead 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
- A new
-
v2.13.5 Changes
August 22, 2024 -
v2.12.1 Changes
September 13, 2024🆕 New Features:
- A new
self._pybind11_conduit_v1_()method is automatically added to allpy::class_-wrapped types, to enable type-safe interoperability between different independent Python/C++ bindings systems, including pybind11 versions with differentPYBIND11_INTERNALS_VERSION's. Supported on pybind11 2.11.2, 2.12.1, and 2.13.6+. #5296
- A new
-
v2.11.2 Changes
September 13, 2024🆕 New Features:
- A new
self._pybind11_conduit_v1_()method is automatically added to allpy::class_-wrapped types, to enable type-safe interoperability between different independent Python/C++ bindings systems, including pybind11 versions with differentPYBIND11_INTERNALS_VERSION's. Supported on pybind11 2.11.2, 2.12.1, and 2.13.6+. #5296
- A new
-
v2.6.1 Changes
November 12, 2020py::exec,py::eval, andpy::eval_filenow add the builtins module as" __builtins__"to theirglobalsargument, better matchingexecandevalin pure Python. #2616- 🍎
setup_helperswill 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 thecaptureobject after theclass_object goes out of scope.
#2634 pybind11_INCLUDE_DIRSwas incorrect, potentially causing a regression if it was expected to includePYTHON_INCLUDE_DIRS(please use targets instead). #2636- ➕ Added parameter names to the
py::enum_constructor and methods, avoidingarg0in the generated docstrings. #2637 - ➕ Added
needs_recompileoptional function to theParallelCompilerhelper, to allow a recompile to be skipped based on a user-defined function. #2643