Removed support for Python 2.7, Python 3.5, and MSVC 2015. Support for MSVC 2017 is limited due to availability of CI runners; we highly recommend MSVC 2019 or 2022 be used. Initial support added for Python 3.11.
New features:
py::anyset & py::frozenset were added, with copying (cast) to std::set (similar to set). #3901
type_caster<std::monostate> was added. std::monostate is a tag type that allows std::variant to act as an optional, or allows default construction of a std::variant holding a non-default constructible type. #3818
pybind11::capsule::set_name added to mutate the name of the capsule instance. #3866
NumPy: dtype constructor from type number added, accessors corresponding to Python API dtype.num, dtype.byteorder, dtype.flags and dtype.alignment added. #3868
Changes:
Python 3.6 is now the minimum supported version. #3688#3719
Fix issues with CPython 3.11 betas and add to supported test matrix. #3923
error_already_set is now safer and more performant, especially for exceptions with long tracebacks, by delaying computation. #1895
Improve exception handling in python str bindings. #3826
The bindings for capsules now have more consistent exception handling. #3825
PYBIND11_OBJECT_CVT and PYBIND11_OBJECT_CVT_DEFAULT macro can now be used to define classes in namespaces other than pybind11. #3797
Error printing code now uses PYBIND11_DETAILED_ERROR_MESSAGES instead of requiring NDEBUG, allowing use with release builds if desired. #3913
Implicit conversion of the literal 0 to pybind11::handle is now disabled. #4008
Bug fixes:
Fix exception handling when pybind11::weakref() fails. #3739
module_::def_submodule was missing proper error handling. This is fixed now. #3973
The behavior or error_already_set was made safer and the highly opaque "Unknown internal error occurred" message was replaced with a more helpful message. #3982
error_already_set::what() now handles non-normalized exceptions correctly. #3971
Support older C++ compilers where filesystem is not yet part of the standard library and is instead included in std::experimental::filesystem. #3840
Fix -Wfree-nonheap-object warnings produced by GCC by avoiding returning pointers to static objects with return_value_policy::take_ownership. #3946
Fix cast from pytype rvalue to another pytype. #3949
Ensure proper behavior when garbage collecting classes with dynamic attributes in Python >=3.9. #4051
A couple long-standing PYBIND11_NAMESPACE__attribute__((visibility("hidden"))) inconsistencies are now fixed (affects only unusual environments). #4043
pybind11::detail::get_internals() is now resilient to in-flight Python exceptions. #3981
Arrays with a dimension of size 0 are now properly converted to dynamic Eigen matrices (more common in NumPy 1.23). #4038
Avoid catching unrelated errors when importing NumPy. #3974
Performance and style:
Added an accessor overload of (object &&key) to reference steal the object when using python types as keys. This prevents unnecessary reference count overhead for attr, dictionary, tuple, and sequence look ups. Added additional regression tests. Fixed a performance bug the caused accessor assignments to potentially perform unnecessary copies. #3970
Removed support for Python 2.7, Python 3.5, and MSVC 2015. Support for MSVC
2017 is limited due to availability of CI runners; we highly recommend MSVC
2019 or 2022 be used. Initial support added for Python 3.11.
New features:
py::anyset & py::frozenset were added, with copying (cast) to
std::set (similar to set).
[#3901](https://github.com/pybind/pybind11/issues/3901) <https://github.com/pybind/pybind11/pull/3901>_
Support bytearray casting to string.
[#3707](https://github.com/pybind/pybind11/issues/3707) <https://github.com/pybind/pybind11/pull/3707>_
type_caster<std::monostate> was added. std::monostate is a tag type
that allows std::variant to act as an optional, or allows default
construction of a std::variant holding a non-default constructible type.
[#3818](https://github.com/pybind/pybind11/issues/3818) <https://github.com/pybind/pybind11/pull/3818>_
pybind11::capsule::set_name added to mutate the name of the capsule instance.
[#3866](https://github.com/pybind/pybind11/issues/3866) <https://github.com/pybind/pybind11/pull/3866>_
NumPy: dtype constructor from type number added, accessors corresponding to
Python API dtype.num, dtype.byteorder, dtype.flags and
dtype.alignment added.
[#3868](https://github.com/pybind/pybind11/issues/3868) <https://github.com/pybind/pybind11/pull/3868>_
Changes:
Python 3.6 is now the minimum supported version.
[#3688](https://github.com/pybind/pybind11/issues/3688) <https://github.com/pybind/pybind11/pull/3688>_
[#3719](https://github.com/pybind/pybind11/issues/3719) <https://github.com/pybind/pybind11/pull/3719>_
The minimum version for MSVC is now 2017.
[#3722](https://github.com/pybind/pybind11/issues/3722) <https://github.com/pybind/pybind11/pull/3722>_
Fix issues with CPython 3.11 betas and add to supported test matrix.
[#3923](https://github.com/pybind/pybind11/issues/3923) <https://github.com/pybind/pybind11/pull/3923>_
error_already_set is now safer and more performant, especially for
exceptions with long tracebacks, by delaying computation.
[#1895](https://github.com/pybind/pybind11/issues/1895) <https://github.com/pybind/pybind11/pull/1895>_
Improve exception handling in python str bindings.
[#3826](https://github.com/pybind/pybind11/issues/3826) <https://github.com/pybind/pybind11/pull/3826>_
The bindings for capsules now have more consistent exception handling.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps pybind11 from 2.9.2 to 2.10.0.
Release notes
Sourced from pybind11's releases.
... (truncated)
Changelog
Sourced from pybind11's changelog.
... (truncated)
Commits
aa304c9
chore: preapre for 2.10.0 release (#4068)87f64c4
docs: update changelog for 2.10.0 (#4066)1d81191
Disable implicit conversion of0
topybind11::handle
. (#4008)bc9315f
chore: optimize sparse matrix casting with python tuple (#4064)6b60d97
docs: use Furo (#3109)7c3a031
chore: bump clang-tidy to 13 (#3997)023b3f3
Undo accidental one-line change under PR #3913 (#4060)790241b
[pre-commit.ci] pre-commit autoupdate (#4058)f9f0049
Properly visit self in >=3.9 traverse (#4051)432bc5c
Addstd::string clean_type_id(const char *typeid_name)
overload (in namespa...Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)