版本发布 8
New Features: - Added helper functions to `py::array` that return shape and strides as `std::span` when available. [#5974](https://github.com/pybind/pybind11/pull/5974) Bug fixes: - Added fallback locking for Python 3.13t where `PyCriticalSection_BeginMutex` is unavailable. [#5981](https://github.com/pybind/pybind11/pull/5981) - Fixed race condition in `py::make_key_iterator` with free-threaded Python. [#5971](https://github.com/pybind/pybind11/pull/5971) - MSVC 19.16 and earlier were blocked from using `std::launder` due to internal compiler errors. [#5968](https://github.com/pybind/pybind11/pull/5968) - Internals destructors were updated to check the owning interpreter before clearing Python objects. [#5965](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5958) [#5972](https://github.com/pybind/pybind11/pull/5972) - Fixed ambiguous `str(handle)` construction for `object`-derived types like `kwargs` or `dict` by templatizing the constructor with SFINAE. [#5949](https://github.com/pybind/pybind11/pull/5949) - Fixed concurrency consistency for `internals_pp_manager` under multiple-interpreters. [#5947](https://github.com/pybind/pybind11/pull/5947) - Fixed MSVC LNK2001 in C++20 builds when /GL (whole program optimization) is enabled. [#5939](https://github.com/pybind/pybind11/pull/5939) - Added per-interpreter storage for `gil_safe_call_once_and_store` to make it safe under multi-interpreters. [#5933](https://github.com/pybind/pybind11/pull/5933) - A workaround for a GCC `-Warray-bounds` false positive in `argument_vector` was added. [#5908](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5891) - Fixed `*args/**kwargs` return types. Added type hinting to `py::make_tuple`. [#5881](https://github.com/pybind/pybind11/pull/5881) - Fixed compiler error in `type_caster_generic` when casting a `T` implicitly convertible from `T*`. [#5873](https://github.com/pybind/pybind11/pull/5873) - Updated `py::native_enum` bindings to unregister enum types on destruction, preventing a use-after-free when returning a destroyed enum instance. [#5871](https://github.com/pybind/pybind11/pull/5871) - Fixed undefined behavior that occurred when importing pybind11 modules from non-main threads created by C API modules or embedded python interpreters. [#5870](https://github.com/pybind/pybind11/pull/5870) - Fixed dangling pointer in `internals::registered_types_cpp_fast`. [#5867](https://github.com/pybind/pybind11/pull/5867) - Added support for `std::shared_ptr<T>` when loading module-local or conduit types from other modules. [#5862](https://github.com/pybind/pybind11/pull/5862) - Fixed thread-safety issues if types were concurrently registered while `get_local_type_info()` was called in free threaded Python. [#5856](https://github.com/pybind/pybind11/pull/5856) - Fixed py::float_ casting and py::int_ and py::float_ type hints. [#5839](https://github.com/pybind/pybind11/pull/5839) - Fixed two `smart_holder` bugs in `shared_ptr` and `unique_ptr` adoption with multiple/virtual inheritance: - `shared_ptr` to-Python caster was updated to register the correct subobject pointer (fixes #5786). - `unique_ptr` adoption was updated to own the proper object start while aliasing subobject pointers for registration, which fixed MSVC crashes during destruction. [#5836](https://github.com/pybind/pybind11/pull/5836) - Constrained `accessor::operator=` templates to avoid obscuring special members. [#5832](https://github.com/pybind/pybind11/pull/5832) - Fixed crash that can occur when finalizers acquire and release the GIL. [#5828](https://github.com/pybind/pybind11/pull/5828) - Fixed compiler detection in `pybind11/detail/pybind11_namespace_macros.h` for clang-cl on Windows, to address warning suppression macros. [#5816](https://github.com/pybind/pybind11/pull/5816) - Fixed compatibility with CMake policy CMP0190 by not always requiring a Python interpreter when cross-compiling. [#5829](https://github.com/pybind/pybind11/pull/5829) - Added a static assertion to disallow `keep_alive` and `call_guard` on properties. [#5533](https://github.com/pybind/pybind11/pull/5533) Internal: - CMake policy limit was set to 4.1. [#5944](https://github.com/pybind/pybind11/pull/5944) - Improved performance of function calls between Python and C++ by switching to the "vectorcall" calling protocol. [#5948](https://github.com/pybind/pybind11/pull/5948) - Many C-style casts were replaced with C++-style casts. [#5930](https://github.com/pybind/pybind11/pull/5930) - Added `cast_sources` abstraction to `type_caster_generic`. [#5866](https://github.com/pybind/pybind11/pull/5866) - Improved the performance of from-Python conversions of legacy pybind11 enum objects bound by `py::enum_`. [#5860](https://github.com/pybind/pybind11/pull/5860) - Reduced size overhead by deduplicating functions' readable signatures and type information. [#5857](https://github.com/pybind/pybind11/pull/5857) - Used new Python 3.14 C APIs when available. [#5854](https://github.com/pybind/pybind11/pull/5854) - Improved performance of function dispatch and type casting by porting two-level type info lookup strategy from nanobind. [#5842](https://github.com/pybind/pybind11/pull/5842) - Updated `.gitignore` to exclude `__pycache__/` directories. [#5838](https://github.com/pybind/pybind11/pull/5838) - Changed internals to use `thread_local` instead of `thread_specific_storage` for increased performance. [#5834](https://github.com/pybind/pybind11/pull/5834) - Reduced function call overhead by using thread_local for loader_life_support when possible. [#5830](https://github.com/pybind/pybind11/pull/5830) - Removed heap allocation for the C++ argument array when dispatching functions with 6 or fewer arguments. [#5824](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5910) - Fixed documentation formatting. [#5903](https://github.com/pybind/pybind11/pull/5903) - Updated upgrade notes for `py::native_enum`. [#5885](https://github.com/pybind/pybind11/pull/5885) - Clarified in the docs to what extent bindings are global. [#5859](https://github.com/pybind/pybind11/pull/5859) Tests: - Fixed deadlock in a free-threading test by releasing the GIL while waiting on synchronization. [#5973](https://github.com/pybind/pybind11/pull/5973) - Calls to `env.deprecated_call()` were replaced with direct calls to `pytest.deprecated_call()`. [#5893](https://github.com/pybind/pybind11/pull/5893) - Updated pytest configuration to use `log_level` instead of `log_cli_level`. [#5890](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5932) - These clang-tidy rules were added: `readability-redundant-casting`, `readability-redundant-inline-specifier`, `readability-redundant-member-init` [#5924](https://github.com/pybind/pybind11/pull/5924) - Replaced deprecated macos-13 runners with macos-15-intel in CI. [#5916](https://github.com/pybind/pybind11/pull/5916) - Restored `runs-on: windows-latest` in CI. [#5835](https://github.com/pybind/pybind11/pull/5835)
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](https://github.com/pybind/pybind11/pull/5542) - Added support for `std::shared_ptr<const T>` in `py::init()` when using `py::smart_holder`, complementing existing support for `std::unique_ptr<const T>`. [#5731](https://github.com/pybind/pybind11/pull/5731) - Support const-only smart pointers. [#5718](https://github.com/pybind/pybind11/pull/5718) - Eliminate cross-DSO RTTI reliance from `trampoline_self_life_support` functionality, `smart_holder` deleter detection, and other `smart_holder` bookkeeping. Resolves platform-specific issues on macOS related to cross-DSO `dynamic_cast` and `typeid` mismatches. [#5728](https://github.com/pybind/pybind11/pull/5728) (replaces [#5700](https://github.com/pybind/pybind11/pull/5700)) - Changed `PYBIND11_MODULE` macro implementation to perform multi-phase module initialization (PEP 489) behind the scenes. [#5574](https://github.com/pybind/pybind11/pull/5574) and avoid destruction [#5688](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5564) - Rename macro `PYBIND11_SUBINTERPRETER_SUPPORT` -> `PYBIND11_HAS_SUBINTERPRETER_SUPPORT` to meet naming convention. [#5682](https://github.com/pybind/pybind11/pull/5682) - Allow subinterpreter support to be disabled if defined to 0. This is mostly an emergency workaround, and is not exposed in CMake. [#5708](https://github.com/pybind/pybind11/pull/5708) and [#5710](https://github.com/pybind/pybind11/pull/5710) - Modify internals pointer-to-pointer implementation to not use `thread_local` (better iOS support). [#5709](https://github.com/pybind/pybind11/pull/5709) - Support implementations without subinterpreter support. [#5732](https://github.com/pybind/pybind11/pull/5732) - 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](https://github.com/pybind/pybind11/pull/5665) and consolidate code [#5670](https://github.com/pybind/pybind11/pull/5670). - Added API in `pybind11/subinterpreter.h` for embedding sub-intepreters (requires Python 3.12+). [#5666](https://github.com/pybind/pybind11/pull/5666) - `py::native_enum` was added, for conversions between Python's native (stdlib) enum types and C++ enums. [#5555](https://github.com/pybind/pybind11/pull/5555) - Add class doc string to `py::native_enum`. [#5617](https://github.com/pybind/pybind11/pull/5617). - Fix signature for functions with a `native_enum` in the signature. [#5619](https://github.com/pybind/pybind11/pull/5619) - Support `py::numpy_scalar<>` / `py::make_scalar()` for NumPy types. [#5726](https://github.com/pybind/pybind11/pull/5726) - A `py::release_gil_before_calling_cpp_dtor` option (for `py::class_`) was added to resolve the long-standing issue \#1446. [#5522](https://github.com/pybind/pybind11/pull/5522) - Add `dtype::normalized_num` and `dtype::num_of`. [#5429](https://github.com/pybind/pybind11/pull/5429) - Add support for `array_t<handle>` and `array_t<object>`. [#5427](https://github.com/pybind/pybind11/pull/5427) - Added `py::warnings` namespace with `py::warnings::warn` and `py::warnings::new_warning_type` that provides the interface for Python warnings. [#5291](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/4686) - The `array_caster` in pybind11/stl.h was enhanced to support value types that are not default-constructible. [#5305](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5375) \| [#5740](https://github.com/pybind/pybind11/pull/5740) - Added support for finding pybind11 using pkgconf distributed on pypi. [#5552](https://github.com/pybind/pybind11/pull/5552) - Support `--extension-suffix` on the pybind11 command. [#5360](https://github.com/pybind/pybind11/pull/5360) - Add semi-public API: `pybind11::detail::is_holder_constructed` and update example for `pybind11::custom_type_setup` in documentation. [#5669](https://github.com/pybind/pybind11/pull/5669) - Added `py::scoped_critical_section` to support free-threaded mode. [#5684](https://github.com/pybind/pybind11/pull/5684) \| [#5706](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5450) - Updated type hint for `py::capsule` to `type.CapsuleType`. [#5567](https://github.com/pybind/pybind11/pull/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](https://github.com/pybind/pybind11/pull/5540) - Rework of arg/return type hints to support `.noconvert()`. [#5486](https://github.com/pybind/pybind11/pull/5486) - Add `attr_with_type` for declaring attribute types and `Final`, `ClassVar` type annotations. [#5460](https://github.com/pybind/pybind11/pull/5460) - Allow annotate methods with `py::pos_only` when only have the `self` argument. Make arguments for auto-generated dunder methods positional-only. [#5403](https://github.com/pybind/pybind11/pull/5403) - Added `py::Args` and `py::KWArgs` to enable custom type hinting of `*args` and `**kwargs` (see PEP 484). [#5357](https://github.com/pybind/pybind11/pull/5357) - Switched to `numpy.typing.NDArray` and `numpy.typing.ArrayLike`. [#5212](https://github.com/pybind/pybind11/pull/5212) - Use `numpy.object_` instead of `object`. [#5571](https://github.com/pybind/pybind11/pull/5571) - Fix module type hint. [#5469](https://github.com/pybind/pybind11/pull/5469) - Fix Buffer type hint. [#5662](https://github.com/pybind/pybind11/pull/5662) - Added support for `collections.abc` in type hints and convertible checks of STL casters and `py::buffer`. [#5566](https://github.com/pybind/pybind11/pull/5566) - Fix `typing` and `collections.abc` type hint ambiguity. [#5663](https://github.com/pybind/pybind11/pull/5663) - Add `typing_extensions` alternatives for all types that need them. [#5693](https://github.com/pybind/pybind11/pull/5693) Removals: - Remove support for pybind11 v2 internals versions (4, 5, 6). (The internals version number has been bumped for pybind11 v3.) [#5512](https://github.com/pybind/pybind11/pull/5512) \| [#5530](https://github.com/pybind/pybind11/pull/5530) - Remove `make_simple_namespace` (added in 2.8.0, deprecated in 2.8.1). [#5597](https://github.com/pybind/pybind11/pull/5597) - Legacy-mode option `PYBIND11_NUMPY_1_ONLY` has been removed. [#5595](https://github.com/pybind/pybind11/pull/5595) - Add a deprecation warning to `.get_type` (deprecated in pybind11 2.6 in 2020). [#5596](https://github.com/pybind/pybind11/pull/5596) Bug fixes: - Set `__file__` on submodules. [#5584](https://github.com/pybind/pybind11/pull/5584). Except on embedded modules. [#5650](https://github.com/pybind/pybind11/pull/5650) - pybind11-bound functions are now pickleable. [#5580](https://github.com/pybind/pybind11/pull/5580) - Fix bug in `attr_with_type_hint` to allow objects to be in `attr_with_type_hint`. [#5576](https://github.com/pybind/pybind11/pull/5576) - A `-Wmaybe-uninitialized` warning suppression was added in `pybind11/eigen/matrix.h`. [#5516](https://github.com/pybind/pybind11/pull/5516) - `PYBIND11_WARNING_POP` was incorrectly defined as `PYBIND11_PRAGMA(clang diagnostic push)`. [#5448](https://github.com/pybind/pybind11/pull/5448) - `PYBIND11_PLATFORM_ABI_ID` (which is used in composing `PYBIND11_INTERNALS_ID`) was modernized to reflect actual ABI compatibility more accurately. [#4953](https://github.com/pybind/pybind11/pull/4953) \| [#5439](https://github.com/pybind/pybind11/pull/5439) - Fix buffer protocol implementation. [#5407](https://github.com/pybind/pybind11/pull/5407) - Fix iterator increment operator does not skip first item. [#5400](https://github.com/pybind/pybind11/pull/5400) - When getting or deleting an element in a container bound by `bind_map`, print the key in `KeyError` if it does not exist. [#5397](https://github.com/pybind/pybind11/pull/5397) - `pybind11::builtin_exception` is now explicitly exported when linked to libc++. [#5390](https://github.com/pybind/pybind11/pull/5390) - Allow subclasses of `py::args` and `py::kwargs`. [#5381](https://github.com/pybind/pybind11/pull/5381) - Disable false-positive GCC 12 Bound Check warning. [#5355](https://github.com/pybind/pybind11/pull/5355) - Update the dict when restoring pickles, instead of assigning a replacement dict. [#5658](https://github.com/pybind/pybind11/pull/5658) - Properly define `_DEBUG` macro to `1` instead of defining it without value. [#5639](https://github.com/pybind/pybind11/pull/5639) - Fix a missing time cast causing a compile error for newer ICC. [#5621](https://github.com/pybind/pybind11/pull/5621) - Change the behavior of the default constructor of `py::slice` to be equivalent to `::` in Python. [#5620](https://github.com/pybind/pybind11/pull/5620) Bug fixes and features (CMake): - Enable FindPython mode by default, with a `COMPAT` mode that sets some of the old variables to ease transition. [#5553](https://github.com/pybind/pybind11/pull/5553) - Add an author warning that auto-calculated `PYTHON_MODULE_EXTENSION` may not respect `SETUPTOOLS_EXT_SUFFIX` during cross-compilation. [#5495](https://github.com/pybind/pybind11/pull/5495) - Don't strip with `CMAKE_BUILD_TYPE` None. [#5392](https://github.com/pybind/pybind11/pull/5392) - Fix an issue with `NO_EXTRAS` adding `pybind11::windows_extras` anyway. [#5378](https://github.com/pybind/pybind11/pull/5378) - Fix issue with NEW/OLD message showing up. [#5656](https://github.com/pybind/pybind11/pull/5656) - Use CMake's warnings as errors if available (CMake 3.24+). [#5612](https://github.com/pybind/pybind11/pull/5612) - Add support for running pybind11's tests via presets in CMake 3.25+. [#5655](https://github.com/pybind/pybind11/pull/5655) and support `--fresh`. [#5668](https://github.com/pybind/pybind11/pull/5668) - Experimental CMake support for Android. [#5733](https://github.com/pybind/pybind11/pull/5733) - Presets now generate `compile_commands.json`. [#5685](https://github.com/pybind/pybind11/pull/5685) Bug fixes (free-threading): - Fix data race in free threaded CPython when accessing a shared static variable. [#5494](https://github.com/pybind/pybind11/pull/5494) - A free-threading data race in `all_type_info()` was fixed. [#5419](https://github.com/pybind/pybind11/pull/5419) - Added exception translator specific mutex used with `try_translate_exceptions` in the free-threaded build for internal locking. [#5362](https://github.com/pybind/pybind11/pull/5362) Internals: - Consolidated all `PYBIND11_HAS_...` feature macros into `pybind11/detail/common.h` to streamline backward compatibility checks and simplify internal refactoring. This change ensures consistent macro availability regardless of header inclusion order. [#5647](https://github.com/pybind/pybind11/pull/5647) - `pybind11/gil_simple.h` was factored out from `pybind11/gil.h`, so that it can easily be reused. [#5614](https://github.com/pybind/pybind11/pull/5614) - Use CPython macros to construct `PYBIND11_VERSION_HEX`. [#5683](https://github.com/pybind/pybind11/pull/5683) Documentation: - Improved `reference_internal` policy documentation. [#5528](https://github.com/pybind/pybind11/pull/5528) - A new "Double locking, deadlocking, GIL" document was added. [#5394](https://github.com/pybind/pybind11/pull/5394) - Add documenting for free-threading and subinterpreters. [#5659](https://github.com/pybind/pybind11/pull/5659) Tests: - Download the final Catch2 2.x release if Catch download is requested. [#5568](https://github.com/pybind/pybind11/pull/5568) - Explicitly used `signed char` for two numpy dtype tests. As seen when compiling using `clang` on Linux with the `-funsigned-char` flag. [#5545](https://github.com/pybind/pybind11/pull/5545) - CI testing now includes `-Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls` in some jobs. [#5523](https://github.com/pybind/pybind11/pull/5523) - Add nightly wheels to scientific-python's nightly wheelhouse. [#5675](https://github.com/pybind/pybind11/pull/5675) - Expect free-threaded warning when loading a non-free-threaded module. [#5680](https://github.com/pybind/pybind11/pull/5680) - Run pytest under Python devmode. [#5715](https://github.com/pybind/pybind11/pull/5715) New and removed platforms: - Support Python 3.14 (beta 1+). [#5646](https://github.com/pybind/pybind11/pull/5646) - Added support for GraalPy Python implementation (<https://github.com/oracle/graalpython>). [#5380](https://github.com/pybind/pybind11/pull/5380) - Support and test iOS in CI. [#5705](https://github.com/pybind/pybind11/pull/5705) - Support for PyPy 3.11 added. [#5508](https://github.com/pybind/pybind11/pull/5508) And test in ci. [#5534](https://github.com/pybind/pybind11/pull/5534) - Support for PyPy 3.8 and 3.9 was dropped. [#5578](https://github.com/pybind/pybind11/pull/5578) - Support for Python 3.7 was removed. (Official end-of-life: 2023-06-27). [#5191](https://github.com/pybind/pybind11/pull/5191) - Support for CMake older than 3.15 removed. CMake 3.15-4.0 supported. [#5304](https://github.com/pybind/pybind11/pull/5304) and fix regression [#5691](https://github.com/pybind/pybind11/pull/5691). - Use scikit-build-core for the build backend for the PyPI `pybind11`. The CMake generation has been moved to the sdist-\>wheel step. `PYBIND11_GLOBAL_SDIST` has been removed. [#5598](https://github.com/pybind/pybind11/pull/5598) and updated docs/ci. [#5676](https://github.com/pybind/pybind11/pull/5676) - clang 20 tested and used for clang-tidy. [#5692](https://github.com/pybind/pybind11/pull/5692) - Drop testing on MSVC 2019 (as it is being removed from GitHub). [#5712](https://github.com/pybind/pybind11/pull/5712) - Support Windows C++20 and Linux C++23 in tests. [#5707](https://github.com/pybind/pybind11/pull/5707)
This is another release candidate. See the changelog in the docs for the combined changelog; this is just the changes since RC 2: * fix(types): type hints from future python versions by @InvincibleRMC in https://github.com/pybind/pybind11/pull/5693 * fix: allow subinterpreters to be manually disabled by @henryiii in https://github.com/pybind/pybind11/pull/5708 * fix: follow rest of pybind11 closer with `PYBIND11_HAS_SUBINTERPRETER_SUPPORT` by @henryiii in https://github.com/pybind/pybind11/pull/5710 * fix: modify the internals pointer-to-pointer implementation to not use `thread_local` by @b-pass in https://github.com/pybind/pybind11/pull/5709 * fix: expose required symbol using clang by @petersteneteg in https://github.com/pybind/pybind11/pull/5700 * fix: handle null `py::handle` and add tests for `py::scoped_critical_section` by @XuehaiPan in https://github.com/pybind/pybind11/pull/5706 * ci: avoid brownout (and removal) of windows-2019 by @henryiii in https://github.com/pybind/pybind11/pull/5712 * ci: ios by @henryiii in https://github.com/pybind/pybind11/pull/5705 * ci: reduced runs on draft PRs by @henryiii in https://github.com/pybind/pybind11/pull/5707 * docs: prepare for RC 3 by @henryiii in https://github.com/pybind/pybind11/pull/5713 > [!WARNING] > Note our iOS support requires a cibuildwheel 3.0 beta currently, the cibuildwheel v3.0.0rc1 does not work. > [!IMPORTANT] > This RC has an ABI bump. We might need one more ABI bump before 3.0 final to improve the protection or our internals. ## New Contributors * @petersteneteg made their first contribution in https://github.com/pybind/pybind11/pull/5700 **Full Changelog**: https://github.com/pybind/pybind11/compare/v3.0.0rc2...v3.0.0rc3
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
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
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: - 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
Bug fixes: - Fix paths with spaces, including on Windows. (Replaces regression from #5302) \#4874 Documentation: - Remove repetitive words. #5308 **Full Changelog**: https://github.com/pybind/pybind11/compare/v2.13.3...v2.13.4