knx/examples/knxPython/pybind11/docs/advanced/classes.rst

1336 lines
47 KiB
ReStructuredText
Raw Normal View History

Classes
#######
This section presents advanced binding code for classes and it is assumed
that you are already familiar with the basics from :doc:`/classes`.
.. _overriding_virtuals:
Overriding virtual functions in Python
======================================
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
Suppose that a C++ class or interface has a virtual function that we'd like
to override from within Python (we'll focus on the class ``Animal``; ``Dog`` is
given as a specific example of how one would do this with traditional C++
code).
.. code-block:: cpp
class Animal {
public:
virtual ~Animal() { }
virtual std::string go(int n_times) = 0;
};
class Dog : public Animal {
public:
std::string go(int n_times) override {
std::string result;
for (int i=0; i<n_times; ++i)
result += "woof! ";
return result;
}
};
Let's also suppose that we are given a plain function which calls the
function ``go()`` on an arbitrary ``Animal`` instance.
.. code-block:: cpp
std::string call_go(Animal *animal) {
return animal->go(3);
}
Normally, the binding code for these classes would look as follows:
.. code-block:: cpp
PYBIND11_MODULE(example, m) {
py::class_<Animal>(m, "Animal")
.def("go", &Animal::go);
py::class_<Dog, Animal>(m, "Dog")
.def(py::init<>());
m.def("call_go", &call_go);
}
However, these bindings are impossible to extend: ``Animal`` is not
constructible, and we clearly require some kind of "trampoline" that
redirects virtual calls back to Python.
Defining a new type of ``Animal`` from within Python is possible but requires a
helper class that is defined as follows:
.. code-block:: cpp
class PyAnimal : public Animal {
public:
/* Inherit the constructors */
using Animal::Animal;
/* Trampoline (need one for each virtual function) */
std::string go(int n_times) override {
PYBIND11_OVERRIDE_PURE(
std::string, /* Return type */
Animal, /* Parent class */
go, /* Name of function in C++ (must match Python name) */
n_times /* Argument(s) */
);
}
};
The macro :c:macro:`PYBIND11_OVERRIDE_PURE` should be used for pure virtual
functions, and :c:macro:`PYBIND11_OVERRIDE` should be used for functions which have
a default implementation. There are also two alternate macros
:c:macro:`PYBIND11_OVERRIDE_PURE_NAME` and :c:macro:`PYBIND11_OVERRIDE_NAME` which
take a string-valued name argument between the *Parent class* and *Name of the
function* slots, which defines the name of function in Python. This is required
when the C++ and Python versions of the
function have different names, e.g. ``operator()`` vs ``__call__``.
The binding code also needs a few minor adaptations (highlighted):
.. code-block:: cpp
:emphasize-lines: 2,3
PYBIND11_MODULE(example, m) {
py::class_<Animal, PyAnimal /* <--- trampoline*/>(m, "Animal")
.def(py::init<>())
.def("go", &Animal::go);
py::class_<Dog, Animal>(m, "Dog")
.def(py::init<>());
m.def("call_go", &call_go);
}
Importantly, pybind11 is made aware of the trampoline helper class by
specifying it as an extra template argument to :class:`class_`. (This can also
be combined with other template arguments such as a custom holder type; the
order of template types does not matter). Following this, we are able to
define a constructor as usual.
Bindings should be made against the actual class, not the trampoline helper class.
.. code-block:: cpp
:emphasize-lines: 3
py::class_<Animal, PyAnimal /* <--- trampoline*/>(m, "Animal");
.def(py::init<>())
.def("go", &PyAnimal::go); /* <--- THIS IS WRONG, use &Animal::go */
Note, however, that the above is sufficient for allowing python classes to
extend ``Animal``, but not ``Dog``: see :ref:`virtual_and_inheritance` for the
necessary steps required to providing proper overriding support for inherited
classes.
The Python session below shows how to override ``Animal::go`` and invoke it via
a virtual method call.
.. code-block:: pycon
>>> from example import *
>>> d = Dog()
>>> call_go(d)
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
'woof! woof! woof! '
>>> class Cat(Animal):
... def go(self, n_times):
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
... return "meow! " * n_times
...
>>> c = Cat()
>>> call_go(c)
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
'meow! meow! meow! '
If you are defining a custom constructor in a derived Python class, you *must*
ensure that you explicitly call the bound C++ constructor using ``__init__``,
*regardless* of whether it is a default constructor or not. Otherwise, the
memory for the C++ portion of the instance will be left uninitialized, which
will generally leave the C++ instance in an invalid state and cause undefined
behavior if the C++ instance is subsequently used.
.. versionchanged:: 2.6
The default pybind11 metaclass will throw a ``TypeError`` when it detects
that ``__init__`` was not called by a derived class.
Here is an example:
.. code-block:: python
class Dachshund(Dog):
def __init__(self, name):
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
Dog.__init__(self) # Without this, a TypeError is raised.
self.name = name
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
def bark(self):
return "yap!"
Note that a direct ``__init__`` constructor *should be called*, and ``super()``
should not be used. For simple cases of linear inheritance, ``super()``
may work, but once you begin mixing Python and C++ multiple inheritance,
things will fall apart due to differences between Python's MRO and C++'s
mechanisms.
Please take a look at the :ref:`macro_notes` before using this feature.
.. note::
When the overridden type returns a reference or pointer to a type that
pybind11 converts from Python (for example, numeric values, std::string,
and other built-in value-converting types), there are some limitations to
be aware of:
- because in these cases there is no C++ variable to reference (the value
is stored in the referenced Python variable), pybind11 provides one in
the PYBIND11_OVERRIDE macros (when needed) with static storage duration.
Note that this means that invoking the overridden method on *any*
instance will change the referenced value stored in *all* instances of
that type.
- Attempts to modify a non-const reference will not have the desired
effect: it will change only the static cache variable, but this change
will not propagate to underlying Python instance, and the change will be
replaced the next time the override is invoked.
.. warning::
The :c:macro:`PYBIND11_OVERRIDE` and accompanying macros used to be called
``PYBIND11_OVERLOAD`` up until pybind11 v2.5.0, and :func:`get_override`
used to be called ``get_overload``. This naming was corrected and the older
macro and function names may soon be deprecated, in order to reduce
confusion with overloaded functions and methods and ``py::overload_cast``
(see :ref:`classes`).
.. seealso::
The file :file:`tests/test_virtual_functions.cpp` contains a complete
example that demonstrates how to override virtual functions using pybind11
in more detail.
.. _virtual_and_inheritance:
Combining virtual functions and inheritance
===========================================
When combining virtual methods with inheritance, you need to be sure to provide
an override for each method for which you want to allow overrides from derived
python classes. For example, suppose we extend the above ``Animal``/``Dog``
example as follows:
.. code-block:: cpp
class Animal {
public:
virtual std::string go(int n_times) = 0;
virtual std::string name() { return "unknown"; }
};
class Dog : public Animal {
public:
std::string go(int n_times) override {
std::string result;
for (int i=0; i<n_times; ++i)
result += bark() + " ";
return result;
}
virtual std::string bark() { return "woof!"; }
};
then the trampoline class for ``Animal`` must, as described in the previous
section, override ``go()`` and ``name()``, but in order to allow python code to
inherit properly from ``Dog``, we also need a trampoline class for ``Dog`` that
overrides both the added ``bark()`` method *and* the ``go()`` and ``name()``
methods inherited from ``Animal`` (even though ``Dog`` doesn't directly
override the ``name()`` method):
.. code-block:: cpp
class PyAnimal : public Animal {
public:
using Animal::Animal; // Inherit constructors
std::string go(int n_times) override { PYBIND11_OVERRIDE_PURE(std::string, Animal, go, n_times); }
std::string name() override { PYBIND11_OVERRIDE(std::string, Animal, name, ); }
};
class PyDog : public Dog {
public:
using Dog::Dog; // Inherit constructors
std::string go(int n_times) override { PYBIND11_OVERRIDE(std::string, Dog, go, n_times); }
std::string name() override { PYBIND11_OVERRIDE(std::string, Dog, name, ); }
std::string bark() override { PYBIND11_OVERRIDE(std::string, Dog, bark, ); }
};
.. note::
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
Note the trailing commas in the ``PYBIND11_OVERRIDE`` calls to ``name()``
and ``bark()``. These are needed to portably implement a trampoline for a
function that does not take any arguments. For functions that take
a nonzero number of arguments, the trailing comma must be omitted.
A registered class derived from a pybind11-registered class with virtual
methods requires a similar trampoline class, *even if* it doesn't explicitly
declare or override any virtual methods itself:
.. code-block:: cpp
class Husky : public Dog {};
class PyHusky : public Husky {
public:
using Husky::Husky; // Inherit constructors
std::string go(int n_times) override { PYBIND11_OVERRIDE_PURE(std::string, Husky, go, n_times); }
std::string name() override { PYBIND11_OVERRIDE(std::string, Husky, name, ); }
std::string bark() override { PYBIND11_OVERRIDE(std::string, Husky, bark, ); }
};
There is, however, a technique that can be used to avoid this duplication
(which can be especially helpful for a base class with several virtual
methods). The technique involves using template trampoline classes, as
follows:
.. code-block:: cpp
template <class AnimalBase = Animal> class PyAnimal : public AnimalBase {
public:
using AnimalBase::AnimalBase; // Inherit constructors
std::string go(int n_times) override { PYBIND11_OVERRIDE_PURE(std::string, AnimalBase, go, n_times); }
std::string name() override { PYBIND11_OVERRIDE(std::string, AnimalBase, name, ); }
};
template <class DogBase = Dog> class PyDog : public PyAnimal<DogBase> {
public:
using PyAnimal<DogBase>::PyAnimal; // Inherit constructors
// Override PyAnimal's pure virtual go() with a non-pure one:
std::string go(int n_times) override { PYBIND11_OVERRIDE(std::string, DogBase, go, n_times); }
std::string bark() override { PYBIND11_OVERRIDE(std::string, DogBase, bark, ); }
};
This technique has the advantage of requiring just one trampoline method to be
declared per virtual method and pure virtual method override. It does,
however, require the compiler to generate at least as many methods (and
possibly more, if both pure virtual and overridden pure virtual methods are
exposed, as above).
The classes are then registered with pybind11 using:
.. code-block:: cpp
py::class_<Animal, PyAnimal<>> animal(m, "Animal");
py::class_<Dog, Animal, PyDog<>> dog(m, "Dog");
py::class_<Husky, Dog, PyDog<Husky>> husky(m, "Husky");
// ... add animal, dog, husky definitions
Note that ``Husky`` did not require a dedicated trampoline template class at
all, since it neither declares any new virtual methods nor provides any pure
virtual method implementations.
With either the repeated-virtuals or templated trampoline methods in place, you
can now create a python class that inherits from ``Dog``:
.. code-block:: python
class ShihTzu(Dog):
def bark(self):
return "yip!"
.. seealso::
See the file :file:`tests/test_virtual_functions.cpp` for complete examples
using both the duplication and templated trampoline approaches.
.. _extended_aliases:
Extended trampoline class functionality
=======================================
.. _extended_class_functionality_forced_trampoline:
Forced trampoline class initialisation
--------------------------------------
The trampoline classes described in the previous sections are, by default, only
initialized when needed. More specifically, they are initialized when a python
class actually inherits from a registered type (instead of merely creating an
instance of the registered type), or when a registered constructor is only
valid for the trampoline class but not the registered class. This is primarily
for performance reasons: when the trampoline class is not needed for anything
except virtual method dispatching, not initializing the trampoline class
improves performance by avoiding needing to do a run-time check to see if the
inheriting python instance has an overridden method.
Sometimes, however, it is useful to always initialize a trampoline class as an
intermediate class that does more than just handle virtual method dispatching.
For example, such a class might perform extra class initialization, extra
destruction operations, and might define new members and methods to enable a
more python-like interface to a class.
In order to tell pybind11 that it should *always* initialize the trampoline
class when creating new instances of a type, the class constructors should be
declared using ``py::init_alias<Args, ...>()`` instead of the usual
``py::init<Args, ...>()``. This forces construction via the trampoline class,
ensuring member initialization and (eventual) destruction.
.. seealso::
See the file :file:`tests/test_virtual_functions.cpp` for complete examples
showing both normal and forced trampoline instantiation.
Different method signatures
---------------------------
The macro's introduced in :ref:`overriding_virtuals` cover most of the standard
use cases when exposing C++ classes to Python. Sometimes it is hard or unwieldy
to create a direct one-on-one mapping between the arguments and method return
type.
An example would be when the C++ signature contains output arguments using
references (See also :ref:`faq_reference_arguments`). Another way of solving
this is to use the method body of the trampoline class to do conversions to the
input and return of the Python method.
The main building block to do so is the :func:`get_override`, this function
allows retrieving a method implemented in Python from within the trampoline's
methods. Consider for example a C++ method which has the signature
``bool myMethod(int32_t& value)``, where the return indicates whether
something should be done with the ``value``. This can be made convenient on the
Python side by allowing the Python function to return ``None`` or an ``int``:
.. code-block:: cpp
bool MyClass::myMethod(int32_t& value)
{
pybind11::gil_scoped_acquire gil; // Acquire the GIL while in this scope.
// Try to look up the overridden method on the Python side.
pybind11::function override = pybind11::get_override(this, "myMethod");
if (override) { // method is found
auto obj = override(value); // Call the Python function.
if (py::isinstance<py::int_>(obj)) { // check if it returned a Python integer type
value = obj.cast<int32_t>(); // Cast it and assign it to the value.
return true; // Return true; value should be used.
} else {
return false; // Python returned none, return false.
}
}
return false; // Alternatively return MyClass::myMethod(value);
}
.. _custom_constructors:
Custom constructors
===================
The syntax for binding constructors was previously introduced, but it only
works when a constructor of the appropriate arguments actually exists on the
C++ side. To extend this to more general cases, pybind11 makes it possible
to bind factory functions as constructors. For example, suppose you have a
class like this:
.. code-block:: cpp
class Example {
private:
Example(int); // private constructor
public:
// Factory function:
static Example create(int a) { return Example(a); }
};
py::class_<Example>(m, "Example")
.def(py::init(&Example::create));
While it is possible to create a straightforward binding of the static
``create`` method, it may sometimes be preferable to expose it as a constructor
on the Python side. This can be accomplished by calling ``.def(py::init(...))``
with the function reference returning the new instance passed as an argument.
It is also possible to use this approach to bind a function returning a new
instance by raw pointer or by the holder (e.g. ``std::unique_ptr``).
The following example shows the different approaches:
.. code-block:: cpp
class Example {
private:
Example(int); // private constructor
public:
// Factory function - returned by value:
static Example create(int a) { return Example(a); }
// These constructors are publicly callable:
Example(double);
Example(int, int);
Example(std::string);
};
py::class_<Example>(m, "Example")
// Bind the factory function as a constructor:
.def(py::init(&Example::create))
// Bind a lambda function returning a pointer wrapped in a holder:
.def(py::init([](std::string arg) {
return std::unique_ptr<Example>(new Example(arg));
}))
// Return a raw pointer:
.def(py::init([](int a, int b) { return new Example(a, b); }))
// You can mix the above with regular C++ constructor bindings as well:
.def(py::init<double>())
;
When the constructor is invoked from Python, pybind11 will call the factory
function and store the resulting C++ instance in the Python instance.
When combining factory functions constructors with :ref:`virtual function
trampolines <overriding_virtuals>` there are two approaches. The first is to
add a constructor to the alias class that takes a base value by
rvalue-reference. If such a constructor is available, it will be used to
construct an alias instance from the value returned by the factory function.
The second option is to provide two factory functions to ``py::init()``: the
first will be invoked when no alias class is required (i.e. when the class is
being used but not inherited from in Python), and the second will be invoked
when an alias is required.
You can also specify a single factory function that always returns an alias
instance: this will result in behaviour similar to ``py::init_alias<...>()``,
as described in the :ref:`extended trampoline class documentation
<extended_aliases>`.
The following example shows the different factory approaches for a class with
an alias:
.. code-block:: cpp
#include <pybind11/factory.h>
class Example {
public:
// ...
virtual ~Example() = default;
};
class PyExample : public Example {
public:
using Example::Example;
PyExample(Example &&base) : Example(std::move(base)) {}
};
py::class_<Example, PyExample>(m, "Example")
// Returns an Example pointer. If a PyExample is needed, the Example
// instance will be moved via the extra constructor in PyExample, above.
.def(py::init([]() { return new Example(); }))
// Two callbacks:
.def(py::init([]() { return new Example(); } /* no alias needed */,
[]() { return new PyExample(); } /* alias needed */))
// *Always* returns an alias instance (like py::init_alias<>())
.def(py::init([]() { return new PyExample(); }))
;
Brace initialization
--------------------
``pybind11::init<>`` internally uses C++11 brace initialization to call the
constructor of the target class. This means that it can be used to bind
*implicit* constructors as well:
.. code-block:: cpp
struct Aggregate {
int a;
std::string b;
};
py::class_<Aggregate>(m, "Aggregate")
.def(py::init<int, const std::string &>());
.. note::
Note that brace initialization preferentially invokes constructor overloads
taking a ``std::initializer_list``. In the rare event that this causes an
issue, you can work around it by using ``py::init(...)`` with a lambda
function that constructs the new object as desired.
.. _classes_with_non_public_destructors:
Non-public destructors
======================
If a class has a private or protected destructor (as might e.g. be the case in
a singleton pattern), a compile error will occur when creating bindings via
pybind11. The underlying issue is that the ``std::unique_ptr`` holder type that
is responsible for managing the lifetime of instances will reference the
destructor even if no deallocations ever take place. In order to expose classes
with private or protected destructors, it is possible to override the holder
type via a holder type argument to ``class_``. Pybind11 provides a helper class
``py::nodelete`` that disables any destructor invocations. In this case, it is
crucial that instances are deallocated on the C++ side to avoid memory leaks.
.. code-block:: cpp
/* ... definition ... */
class MyClass {
private:
~MyClass() { }
};
/* ... binding code ... */
py::class_<MyClass, std::unique_ptr<MyClass, py::nodelete>>(m, "MyClass")
.def(py::init<>())
.. _destructors_that_call_python:
Destructors that call Python
============================
If a Python function is invoked from a C++ destructor, an exception may be thrown
of type :class:`error_already_set`. If this error is thrown out of a class destructor,
``std::terminate()`` will be called, terminating the process. Class destructors
must catch all exceptions of type :class:`error_already_set` to discard the Python
exception using :func:`error_already_set::discard_as_unraisable`.
Every Python function should be treated as *possibly throwing*. When a Python generator
stops yielding items, Python will throw a ``StopIteration`` exception, which can pass
though C++ destructors if the generator's stack frame holds the last reference to C++
objects.
For more information, see :ref:`the documentation on exceptions <unraisable_exceptions>`.
.. code-block:: cpp
class MyClass {
public:
~MyClass() {
try {
py::print("Even printing is dangerous in a destructor");
py::exec("raise ValueError('This is an unraisable exception')");
} catch (py::error_already_set &e) {
// error_context should be information about where/why the occurred,
// e.g. use __func__ to get the name of the current function
e.discard_as_unraisable(__func__);
}
}
};
.. note::
pybind11 does not support C++ destructors marked ``noexcept(false)``.
.. versionadded:: 2.6
.. _implicit_conversions:
Implicit conversions
====================
Suppose that instances of two types ``A`` and ``B`` are used in a project, and
that an ``A`` can easily be converted into an instance of type ``B`` (examples of this
could be a fixed and an arbitrary precision number type).
.. code-block:: cpp
py::class_<A>(m, "A")
/// ... members ...
py::class_<B>(m, "B")
.def(py::init<A>())
/// ... members ...
m.def("func",
[](const B &) { /* .... */ }
);
To invoke the function ``func`` using a variable ``a`` containing an ``A``
instance, we'd have to write ``func(B(a))`` in Python. On the other hand, C++
will automatically apply an implicit type conversion, which makes it possible
to directly write ``func(a)``.
In this situation (i.e. where ``B`` has a constructor that converts from
``A``), the following statement enables similar implicit conversions on the
Python side:
.. code-block:: cpp
py::implicitly_convertible<A, B>();
.. note::
Implicit conversions from ``A`` to ``B`` only work when ``B`` is a custom
data type that is exposed to Python via pybind11.
To prevent runaway recursion, implicit conversions are non-reentrant: an
implicit conversion invoked as part of another implicit conversion of the
same type (i.e. from ``A`` to ``B``) will fail.
.. _static_properties:
Static properties
=================
The section on :ref:`properties` discussed the creation of instance properties
that are implemented in terms of C++ getters and setters.
Static properties can also be created in a similar way to expose getters and
setters of static class attributes. Note that the implicit ``self`` argument
also exists in this case and is used to pass the Python ``type`` subclass
instance. This parameter will often not be needed by the C++ side, and the
following example illustrates how to instantiate a lambda getter function
that ignores it:
.. code-block:: cpp
py::class_<Foo>(m, "Foo")
.def_property_readonly_static("foo", [](py::object /* self */) { return Foo(); });
Operator overloading
====================
Suppose that we're given the following ``Vector2`` class with a vector addition
and scalar multiplication operation, all implemented using overloaded operators
in C++.
.. code-block:: cpp
class Vector2 {
public:
Vector2(float x, float y) : x(x), y(y) { }
Vector2 operator+(const Vector2 &v) const { return Vector2(x + v.x, y + v.y); }
Vector2 operator*(float value) const { return Vector2(x * value, y * value); }
Vector2& operator+=(const Vector2 &v) { x += v.x; y += v.y; return *this; }
Vector2& operator*=(float v) { x *= v; y *= v; return *this; }
friend Vector2 operator*(float f, const Vector2 &v) {
return Vector2(f * v.x, f * v.y);
}
std::string toString() const {
return "[" + std::to_string(x) + ", " + std::to_string(y) + "]";
}
private:
float x, y;
};
The following snippet shows how the above operators can be conveniently exposed
to Python.
.. code-block:: cpp
#include <pybind11/operators.h>
PYBIND11_MODULE(example, m) {
py::class_<Vector2>(m, "Vector2")
.def(py::init<float, float>())
.def(py::self + py::self)
.def(py::self += py::self)
.def(py::self *= float())
.def(float() * py::self)
.def(py::self * float())
.def(-py::self)
.def("__repr__", &Vector2::toString);
}
Note that a line like
.. code-block:: cpp
.def(py::self * float())
is really just short hand notation for
.. code-block:: cpp
.def("__mul__", [](const Vector2 &a, float b) {
return a * b;
}, py::is_operator())
This can be useful for exposing additional operators that don't exist on the
C++ side, or to perform other types of customization. The ``py::is_operator``
flag marker is needed to inform pybind11 that this is an operator, which
returns ``NotImplemented`` when invoked with incompatible arguments rather than
throwing a type error.
.. note::
To use the more convenient ``py::self`` notation, the additional
header file :file:`pybind11/operators.h` must be included.
.. seealso::
The file :file:`tests/test_operator_overloading.cpp` contains a
complete example that demonstrates how to work with overloaded operators in
more detail.
.. _pickling:
Pickling support
================
Python's ``pickle`` module provides a powerful facility to serialize and
de-serialize a Python object graph into a binary data stream. To pickle and
unpickle C++ classes using pybind11, a ``py::pickle()`` definition must be
provided. Suppose the class in question has the following signature:
.. code-block:: cpp
class Pickleable {
public:
Pickleable(const std::string &value) : m_value(value) { }
const std::string &value() const { return m_value; }
void setExtra(int extra) { m_extra = extra; }
int extra() const { return m_extra; }
private:
std::string m_value;
int m_extra = 0;
};
Pickling support in Python is enabled by defining the ``__setstate__`` and
``__getstate__`` methods [#f3]_. For pybind11 classes, use ``py::pickle()``
to bind these two functions:
.. code-block:: cpp
py::class_<Pickleable>(m, "Pickleable")
.def(py::init<std::string>())
.def("value", &Pickleable::value)
.def("extra", &Pickleable::extra)
.def("setExtra", &Pickleable::setExtra)
.def(py::pickle(
[](const Pickleable &p) { // __getstate__
/* Return a tuple that fully encodes the state of the object */
return py::make_tuple(p.value(), p.extra());
},
[](py::tuple t) { // __setstate__
if (t.size() != 2)
throw std::runtime_error("Invalid state!");
/* Create a new C++ instance */
Pickleable p(t[0].cast<std::string>());
/* Assign any additional state */
p.setExtra(t[1].cast<int>());
return p;
}
));
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
The ``__setstate__`` part of the ``py::pickle()`` definition follows the same
rules as the single-argument version of ``py::init()``. The return type can be
a value, pointer or holder type. See :ref:`custom_constructors` for details.
An instance can now be pickled as follows:
.. code-block:: python
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
import pickle
p = Pickleable("test_value")
p.setExtra(15)
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
data = pickle.dumps(p)
.. note::
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
If given, the second argument to ``dumps`` must be 2 or larger - 0 and 1 are
not supported. Newer versions are also fine; for instance, specify ``-1`` to
always use the latest available version. Beware: failure to follow these
instructions will cause important pybind11 memory allocation routines to be
skipped during unpickling, which will likely lead to memory corruption
and/or segmentation faults. Python defaults to version 3 (Python 3-3.7) and
version 4 for Python 3.8+.
.. seealso::
The file :file:`tests/test_pickling.cpp` contains a complete example
that demonstrates how to pickle and unpickle types using pybind11 in more
detail.
.. [#f3] http://docs.python.org/3/library/pickle.html#pickling-class-instances
Deepcopy support
================
Python normally uses references in assignments. Sometimes a real copy is needed
to prevent changing all copies. The ``copy`` module [#f5]_ provides these
capabilities.
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
A class with pickle support is automatically also (deep)copy
compatible. However, performance can be improved by adding custom
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
``__copy__`` and ``__deepcopy__`` methods.
For simple classes (deep)copy can be enabled by using the copy constructor,
which should look as follows:
.. code-block:: cpp
py::class_<Copyable>(m, "Copyable")
.def("__copy__", [](const Copyable &self) {
return Copyable(self);
})
.def("__deepcopy__", [](const Copyable &self, py::dict) {
return Copyable(self);
}, "memo"_a);
.. note::
Dynamic attributes will not be copied in this example.
.. [#f5] https://docs.python.org/3/library/copy.html
Multiple Inheritance
====================
pybind11 can create bindings for types that derive from multiple base types
(aka. *multiple inheritance*). To do so, specify all bases in the template
arguments of the ``class_`` declaration:
.. code-block:: cpp
py::class_<MyType, BaseType1, BaseType2, BaseType3>(m, "MyType")
...
The base types can be specified in arbitrary order, and they can even be
interspersed with alias types and holder types (discussed earlier in this
document)---pybind11 will automatically find out which is which. The only
requirement is that the first template argument is the type to be declared.
It is also permitted to inherit multiply from exported C++ classes in Python,
as well as inheriting from multiple Python and/or pybind11-exported classes.
There is one caveat regarding the implementation of this feature:
When only one base type is specified for a C++ type that actually has multiple
bases, pybind11 will assume that it does not participate in multiple
inheritance, which can lead to undefined behavior. In such cases, add the tag
``multiple_inheritance`` to the class constructor:
.. code-block:: cpp
py::class_<MyType, BaseType2>(m, "MyType", py::multiple_inheritance());
The tag is redundant and does not need to be specified when multiple base types
are listed.
.. _module_local:
Module-local class bindings
===========================
When creating a binding for a class, pybind11 by default makes that binding
"global" across modules. What this means is that a type defined in one module
can be returned from any module resulting in the same Python type. For
example, this allows the following:
.. code-block:: cpp
// In the module1.cpp binding code for module1:
py::class_<Pet>(m, "Pet")
.def(py::init<std::string>())
.def_readonly("name", &Pet::name);
.. code-block:: cpp
// In the module2.cpp binding code for module2:
m.def("create_pet", [](std::string name) { return new Pet(name); });
.. code-block:: pycon
>>> from module1 import Pet
>>> from module2 import create_pet
>>> pet1 = Pet("Kitty")
>>> pet2 = create_pet("Doggy")
>>> pet2.name()
'Doggy'
When writing binding code for a library, this is usually desirable: this
allows, for example, splitting up a complex library into multiple Python
modules.
In some cases, however, this can cause conflicts. For example, suppose two
unrelated modules make use of an external C++ library and each provide custom
bindings for one of that library's classes. This will result in an error when
a Python program attempts to import both modules (directly or indirectly)
because of conflicting definitions on the external type:
.. code-block:: cpp
// dogs.cpp
// Binding for external library class:
py::class<pets::Pet>(m, "Pet")
.def("name", &pets::Pet::name);
// Binding for local extension class:
py::class<Dog, pets::Pet>(m, "Dog")
.def(py::init<std::string>());
.. code-block:: cpp
// cats.cpp, in a completely separate project from the above dogs.cpp.
// Binding for external library class:
py::class<pets::Pet>(m, "Pet")
.def("get_name", &pets::Pet::name);
// Binding for local extending class:
py::class<Cat, pets::Pet>(m, "Cat")
.def(py::init<std::string>());
.. code-block:: pycon
>>> import cats
>>> import dogs
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: generic_type: type "Pet" is already registered!
To get around this, you can tell pybind11 to keep the external class binding
localized to the module by passing the ``py::module_local()`` attribute into
the ``py::class_`` constructor:
.. code-block:: cpp
// Pet binding in dogs.cpp:
py::class<pets::Pet>(m, "Pet", py::module_local())
.def("name", &pets::Pet::name);
.. code-block:: cpp
// Pet binding in cats.cpp:
py::class<pets::Pet>(m, "Pet", py::module_local())
.def("get_name", &pets::Pet::name);
This makes the Python-side ``dogs.Pet`` and ``cats.Pet`` into distinct classes,
avoiding the conflict and allowing both modules to be loaded. C++ code in the
``dogs`` module that casts or returns a ``Pet`` instance will result in a
``dogs.Pet`` Python instance, while C++ code in the ``cats`` module will result
in a ``cats.Pet`` Python instance.
This does come with two caveats, however: First, external modules cannot return
or cast a ``Pet`` instance to Python (unless they also provide their own local
bindings). Second, from the Python point of view they are two distinct classes.
Note that the locality only applies in the C++ -> Python direction. When
passing such a ``py::module_local`` type into a C++ function, the module-local
classes are still considered. This means that if the following function is
added to any module (including but not limited to the ``cats`` and ``dogs``
modules above) it will be callable with either a ``dogs.Pet`` or ``cats.Pet``
argument:
.. code-block:: cpp
m.def("pet_name", [](const pets::Pet &pet) { return pet.name(); });
For example, suppose the above function is added to each of ``cats.cpp``,
``dogs.cpp`` and ``frogs.cpp`` (where ``frogs.cpp`` is some other module that
does *not* bind ``Pets`` at all).
.. code-block:: pycon
>>> import cats, dogs, frogs # No error because of the added py::module_local()
>>> mycat, mydog = cats.Cat("Fluffy"), dogs.Dog("Rover")
>>> (cats.pet_name(mycat), dogs.pet_name(mydog))
('Fluffy', 'Rover')
>>> (cats.pet_name(mydog), dogs.pet_name(mycat), frogs.pet_name(mycat))
('Rover', 'Fluffy', 'Fluffy')
It is possible to use ``py::module_local()`` registrations in one module even
if another module registers the same type globally: within the module with the
module-local definition, all C++ instances will be cast to the associated bound
Python type. In other modules any such values are converted to the global
Python type created elsewhere.
.. note::
STL bindings (as provided via the optional :file:`pybind11/stl_bind.h`
header) apply ``py::module_local`` by default when the bound type might
conflict with other modules; see :ref:`stl_bind` for details.
.. note::
The localization of the bound types is actually tied to the shared object
or binary generated by the compiler/linker. For typical modules created
with ``PYBIND11_MODULE()``, this distinction is not significant. It is
possible, however, when :ref:`embedding` to embed multiple modules in the
same binary (see :ref:`embedding_modules`). In such a case, the
localization will apply across all embedded modules within the same binary.
.. seealso::
The file :file:`tests/test_local_bindings.cpp` contains additional examples
that demonstrate how ``py::module_local()`` works.
Binding protected member functions
==================================
It's normally not possible to expose ``protected`` member functions to Python:
.. code-block:: cpp
class A {
protected:
int foo() const { return 42; }
};
py::class_<A>(m, "A")
.def("foo", &A::foo); // error: 'foo' is a protected member of 'A'
On one hand, this is good because non-``public`` members aren't meant to be
accessed from the outside. But we may want to make use of ``protected``
functions in derived Python classes.
The following pattern makes this possible:
.. code-block:: cpp
class A {
protected:
int foo() const { return 42; }
};
class Publicist : public A { // helper type for exposing protected functions
public:
using A::foo; // inherited with different access modifier
};
py::class_<A>(m, "A") // bind the primary class
.def("foo", &Publicist::foo); // expose protected methods via the publicist
This works because ``&Publicist::foo`` is exactly the same function as
``&A::foo`` (same signature and address), just with a different access
modifier. The only purpose of the ``Publicist`` helper class is to make
the function name ``public``.
If the intent is to expose ``protected`` ``virtual`` functions which can be
overridden in Python, the publicist pattern can be combined with the previously
described trampoline:
.. code-block:: cpp
class A {
public:
virtual ~A() = default;
protected:
virtual int foo() const { return 42; }
};
class Trampoline : public A {
public:
int foo() const override { PYBIND11_OVERRIDE(int, A, foo, ); }
};
class Publicist : public A {
public:
using A::foo;
};
py::class_<A, Trampoline>(m, "A") // <-- `Trampoline` here
.def("foo", &Publicist::foo); // <-- `Publicist` here, not `Trampoline`!
Binding final classes
=====================
Some classes may not be appropriate to inherit from. In C++11, classes can
use the ``final`` specifier to ensure that a class cannot be inherited from.
The ``py::is_final`` attribute can be used to ensure that Python classes
cannot inherit from a specified type. The underlying C++ type does not need
to be declared final.
.. code-block:: cpp
class IsFinal final {};
py::class_<IsFinal>(m, "IsFinal", py::is_final());
When you try to inherit from such a class in Python, you will now get this
error:
.. code-block:: pycon
>>> class PyFinalChild(IsFinal):
... pass
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
...
TypeError: type 'IsFinal' is not an acceptable base type
.. note:: This attribute is currently ignored on PyPy
.. versionadded:: 2.6
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
Binding classes with template parameters
========================================
pybind11 can also wrap classes that have template parameters. Consider these classes:
.. code-block:: cpp
struct Cat {};
struct Dog {};
template <typename PetType>
struct Cage {
Cage(PetType& pet);
PetType& get();
};
C++ templates may only be instantiated at compile time, so pybind11 can only
wrap instantiated templated classes. You cannot wrap a non-instantiated template:
.. code-block:: cpp
// BROKEN (this will not compile)
py::class_<Cage>(m, "Cage");
.def("get", &Cage::get);
You must explicitly specify each template/type combination that you want to
wrap separately.
.. code-block:: cpp
// ok
py::class_<Cage<Cat>>(m, "CatCage")
.def("get", &Cage<Cat>::get);
// ok
py::class_<Cage<Dog>>(m, "DogCage")
.def("get", &Cage<Dog>::get);
If your class methods have template parameters you can wrap those as well,
but once again each instantiation must be explicitly specified:
.. code-block:: cpp
typename <typename T>
struct MyClass {
template <typename V>
T fn(V v);
};
py::class<MyClass<int>>(m, "MyClassT")
.def("fn", &MyClass<int>::fn<std::string>);
Custom automatic downcasters
============================
As explained in :ref:`inheritance`, pybind11 comes with built-in
understanding of the dynamic type of polymorphic objects in C++; that
is, returning a Pet to Python produces a Python object that knows it's
wrapping a Dog, if Pet has virtual methods and pybind11 knows about
Dog and this Pet is in fact a Dog. Sometimes, you might want to
provide this automatic downcasting behavior when creating bindings for
a class hierarchy that does not use standard C++ polymorphism, such as
LLVM [#f4]_. As long as there's some way to determine at runtime
whether a downcast is safe, you can proceed by specializing the
``pybind11::polymorphic_type_hook`` template:
.. code-block:: cpp
enum class PetKind { Cat, Dog, Zebra };
struct Pet { // Not polymorphic: has no virtual methods
const PetKind kind;
int age = 0;
protected:
Pet(PetKind _kind) : kind(_kind) {}
};
struct Dog : Pet {
Dog() : Pet(PetKind::Dog) {}
std::string sound = "woof!";
std::string bark() const { return sound; }
};
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
namespace PYBIND11_NAMESPACE {
template<> struct polymorphic_type_hook<Pet> {
static const void *get(const Pet *src, const std::type_info*& type) {
// note that src may be nullptr
if (src && src->kind == PetKind::Dog) {
type = &typeid(Dog);
return static_cast<const Dog*>(src);
}
return src;
}
};
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
} // namespace PYBIND11_NAMESPACE
When pybind11 wants to convert a C++ pointer of type ``Base*`` to a
Python object, it calls ``polymorphic_type_hook<Base>::get()`` to
determine if a downcast is possible. The ``get()`` function should use
whatever runtime information is available to determine if its ``src``
parameter is in fact an instance of some class ``Derived`` that
inherits from ``Base``. If it finds such a ``Derived``, it sets ``type
= &typeid(Derived)`` and returns a pointer to the ``Derived`` object
that contains ``src``. Otherwise, it just returns ``src``, leaving
``type`` at its default value of nullptr. If you set ``type`` to a
type that pybind11 doesn't know about, no downcasting will occur, and
the original ``src`` pointer will be used with its static type
``Base*``.
It is critical that the returned pointer and ``type`` argument of
``get()`` agree with each other: if ``type`` is set to something
non-null, the returned pointer must point to the start of an object
whose type is ``type``. If the hierarchy being exposed uses only
single inheritance, a simple ``return src;`` will achieve this just
fine, but in the general case, you must cast ``src`` to the
appropriate derived-class pointer (e.g. using
``static_cast<Derived>(src)``) before allowing it to be returned as a
``void*``.
.. [#f4] https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html
.. note::
pybind11's standard support for downcasting objects whose types
have virtual methods is implemented using
``polymorphic_type_hook`` too, using the standard C++ ability to
determine the most-derived type of a polymorphic object using
``typeid()`` and to cast a base pointer to that most-derived type
(even if you don't know what it is) using ``dynamic_cast<void*>``.
.. seealso::
The file :file:`tests/test_tagbased_polymorphic.cpp` contains a
more complete example, including a demonstration of how to provide
automatic downcasting for an entire class hierarchy without
writing one get() function for each class.
Accessing the type object
=========================
You can get the type object from a C++ class that has already been registered using:
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
.. code-block:: cpp
py::type T_py = py::type::of<T>();
You can directly use ``py::type::of(ob)`` to get the type object from any python
object, just like ``type(ob)`` in Python.
.. note::
Other types, like ``py::type::of<int>()``, do not work, see :ref:`type-conversions`.
.. versionadded:: 2.6
Squashed 'examples/knxPython/pybind11/' changes from 59a2ac27..941f45bc 941f45bc chore: prepare for 2.13.1 63020d33 docs: prepare for 2.13.1 (#5203) dd0e4a0b feat(types): add support for Typing.Callable Special Case (#5202) 3b47b464 fix: use manual padding of instance_map_shard (#5200) 0c69e1eb chore: prepare for 2.13.0 (#5198) 2be85c60 feat(types): adds support for TypeGuard and TypeIs (#5194) b5ec7c71 ci: release with trusted publisher and attestations (#5196) 26281c79 feat(types): adds support for Never and NoReturn from python Typing (#5193) 183059f9 feat(types): add support for typing.Literal type (#5192) aebcd704 Add TypeVars / method generics typing (#5167) 9ec64e37 docs: prepare for 2.13.0 (#5187) a406a62e fix: use `std::addressof` in type_caster_base.h (#5189) f1a2e03d feat: remove Python 3.6 support (#5177) 5552cbf2 Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179) 186df220 docs: building suggestions update (#5168) baa540ec fix: support free-threaded CPython with GIL disabled (#5148) 1961b96a chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /docs (#5170) fdd20d69 chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5169) 7c4ac91d Add type[T] support to typing.h (#5166) 68405a11 Add `Union` and `Optional` to typing.h (#5165) ab955f15 Fix refcount bug involving trampoline functions with `PyObject *` return type. (#5156) 35ff42b5 Add a pybind function to clear a list. (#5153) 9b3a2000 fix(cmake): improved cross-compilation support (#5083) b9794be4 chore(deps): update pre-commit hooks (#5154) 1a0ff405 tests: avoid immortal objects in tests (#5150) 7187894e fix(cmake): old cmake boost bug (#5149) ae6432b8 fix: Python 3.13t with GIL (#5139) a5b9e50f fix: added check on iterator end position (#5129) ce08e370 fix: handle NULL correctly (#5145) 86a64290 chore: some cleanup (#5137) 4d0fcedc fix: support Python 3.13.0b1 (PEP 667 fix) (#5127) b07fddb2 --- (#5130) aa98d957 chore(deps): update pre-commit hooks (#5123) ede061ca chore(deps): bump the actions group with 1 update (#5082) 75025779 chore(deps): bump jinja2 from 3.1.3 to 3.1.4 in /docs (#5122) c9747570 chore(deps): bump idna from 3.6 to 3.7 in /docs (#5121) 6497b3f2 docs(numpy): drop duplicated ndim (#5119) a9256a6d chore: docs and nox bump (#5071) f3984794 ci: macos-latest is changing to macos-14 ARM runners (#5109) 19a6b9f4 Fix typo in changelog date (#5096) f33f6afb chore(deps): update pre-commit hooks (#5084) 7f2214bc chore: bump cmake to 3.29 (#5075) 7af193e7 chore: get back to work b91b584d docs: remove extra space 3e9dfa28 docs: a few missed changes for 2.12 (#5074) 6b5674f3 chore: prepare 2.12.0 (#5070) 67c9c568 fix: fully qualify usages of concat to protect against ADL (#4955) 0efff79f Bug fixes: Add missing `handle_type_name` specializations. (#5073) 705efcce feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) e0f2c715 tests: hide warning on clang (#5069) 65370f33 Create handle_type_name specialization to type-hint variable length tuples (#5051) ddb8b67a fix(cmake): allow forcing old FindPython (#5042) ec73bdaf ci: skipping test for Windows Clang failure (#5062) 8b48ff87 chore(deps): bump the actions group with 3 updates (#5024) 0518bf9f ci: ignore actions/checkout until v5 comes out e84d446d ci: Ignore v1 updates for checkout (#5023) 416f7a44 chore(deps): update pre-commit hooks (#5018) 768cebe1 doc: add litgen to the automatic generators list (compiling.rst) (#5012) 869cc1ff install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 39e65e10 ci: group dependabot updates (#4986) 31b7e140 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) aec6cc54 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) f29def9e chore(deps): update pre-commit hooks (#4994) b583336c chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) 976fea05 Fix Clazy warnings (#4988) eeac2f45 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) e8a43ea9 chore(deps): bump actions/download-artifact from 3 to 4 (#4976) dc477fac fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) daea1130 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 7d538a42 fix: make_static_property_type() (#4971) 68322895 chore(deps): bump actions/setup-python from 4 to 5 (#4965) c1e06f5b chore(deps): update pre-commit hooks (#4963) a67d7865 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) 4bb6163b chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) dc9b3959 pybind11.pc: use pcfiledir for relative destinations (#4830) 9591cfb0 fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) 6831666f ci: add more versions of numpy/scipy/pypy (#4714) 6cf90e72 fix(cmake): avoid really slow compile on emscripten (#4642) b389ae77 chore: update changelog script for categories (#4942) e250155a Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2c35fde3 Fix refcount bug introduced with PR #4916. (#4927) c758b81f chore: move to ruff-format (#4912) 0a974fed chore(deps): update pre-commit hooks (#4923) f2606930 Use newer PyCode API and other fixes (#4916) 31b0a5d9 fix doc typo 76b7f536 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) a18c10f6 fix(cmake): make library component optional (#4805) 3aece819 chore: update hooks and Ruff config (#4904) 1e28599e fix: Add missing spaces to error string (#4906) fa27d2fd Adapt to changed function name in Python 3.13 (#4902) bf88e29c Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) 3414c56b Workaround NVCC parse failure in `cast_op` (#4893) 7969049d Comment out failing job, with link to #4889 (#4890) 74439a64 feature: Use typed iterators in `make_*iterator` (#4876) 0cbd92ba Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) 0e2c3e5d Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) 6c772085 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) 2b2e4ca4 chore(deps): update pre-commit hooks (#4868) dd64df73 MAINT: Remove np.int_ (#4867) 0a756c0b MAINT: Include `numpy._core` imports (#4857) f468b070 Add 2 missing `throw error_already_set();` (#4863) 7e5edbc9 Avoid copy in iteration by using const auto & (#4861) 5891867e fix(cmake): support DEBUG_POSTFIX correctly (#4761) 4fb111bd fix(cmake): correctly detect FindPython policy and better warning (#4806) d06d5369 Fix small bug introduced with PR #4735 (#4845) 8c7b8dd0 fix: Missing typed variants of `iterator` and `iterable` (#4832) b4573674 Update render for buffer sequence and handle (#4831) c9149d99 fix: Use lowercase builtin collection names (#4833) c8360593 feature: Support move-only iterators in `py::make_*iterator` (#4834) 4a2f7e46 chore(deps): bump actions/checkout from 1 to 4 (#4836) 467fe27b chore(deps): update pre-commit hooks (#4838) c9638a19 Help Coverty avoid generating a false positive. (#4817) db412e6e fix: Render `py::function` as `Callable` (#4829) e705fb5f Fix enum's `__str__` docstring (#4827) 1adac5a5 `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 76b88581 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) b9359cea Remove newlines from docstring signature (#4735) f47ff328 Fix grammar in functions.rst (#4791) 80bcd21f [ci skip] Adopt nanobind config. (#4792) add281a2 Migrate to readthedocs configuration file v2¶ (#4789) 9039e6ac chore: use 2x faster black mirror (#4784) 4bf60c60 Disable strip when build type is unset (#4454) (#4780) 690a115d Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) 824dc27a CI: Reenable an NVHPC Test (#4764) f8703154 Provide better type hints for a variety of generic types (#4259) 9ad7e827 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) 413e6328 chore(deps): update pre-commit hooks (#4770) 17b61430 clang 17 compatibility fixes (#4767) f3e06028 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) 8d08dc64 Copy v2.11.1 changelog section as released. (#4755) 99131a85 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) ec1b57c5 Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 0620d716 Update README.rst - Add missing comma in the list of acknowlegements (#4750) e85696e8 Post release version bump (#4747) 1a917f18 docs: preparation for v2.11.0 release (#4744) b33d06f6 bugfix: fixes a test suite bug in the __new__ example (#4698) 2e5f5c4c fix: support CMake 3.27, drop 3.4 (#4719) 6d22dba8 Warning on comparing wrapper enums with is (#4732) b2732c6e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) 47dc0c4b chore(deps): update pre-commit hooks (#4727) d462dd91 chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731) 782b6281 Drop PyPy 3.7 from GitHub Actions (ci.yml) (#4728) 5ccb9e41 chore: ruff moved to astral-sh (#4726) 2fb3d7cb Trivial refactoring to make the capsule API more user friendly. (#4720) e10da79b Undo ci.yml gcc10 workaround after docker-library/gcc#95 was resolved. (#4717) bc1bcf7c chore: 3.12 + cleanup (#4713) 84932280 Systematically add `PIP_BREAK_SYSTEM_PACKAGES` to all .yml files from which pip is called. (#4705) 86f60a0c pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704) 0e43fcc7 Python 3.12b2 testing (#4695) c679a920 chore(deps): bump deadsnakes/action from 3.0.0 to 3.0.1 (#4687) 3617f355 chore(deps): update pre-commit hooks (#4689) 29487dee Disable 🐍 3 • CentOS7 / PGI 22.9 • x64 (#4691) d0232b11 Use annotated for array (#4679) 8e1f9d5c Add `format_descriptor<>` & `npy_format_descriptor<>` `PyObject *` specializations. (#4674) 6e6bcca5 Create s Security Policy (#4671) ce9bbc0a Python 3.11+: Add `__notes__` to `error_already_set::what()` output. (#4678) 19816f0d chore: update changelog, with target date for v2.11.0 release (#4677) d72ffb44 ci: set minimal permissions to github workflows (#4665) cca4c51c Update errors in string "Explicit conversions" docs (#4658) e9b961d9 Elide to-python conversion of setter return values (#4621) 90312a6e Add `type_caster<PyObject>` (#4601) f7016546 Introduce recursive_container_traits (#4623) b3e88ecf chore(deps): update pre-commit hooks (#4648) dff75a62 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#4650) da919262 fix: remove -stdlib=libc++ from setup helpers, not needed on modern Pythons (#4639) 956390a8 fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643) 5e946c2f chore(deps): update pre-commit hooks (#4605) 3f366ff8 Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 6de6191a Use `std::hash<std::type_index>`, `std::equal_to<std::type_index>` everywhere **except when libc++ is in use** (#4319) ff7f5dfc 1. Fully test unstable ABI (#4635) 07725c28 Introduce `pybind11::detail::is_move_constructible` (#4631) 071f35ab chore(deps): bump jwlawson/actions-setup-cmake from 1.13 to 1.14 (#4632) ed466da5 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (#4604) 7ab88d2e chore(deps): bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.4 (#4602) 4ce05175 ci: Python 3.12 optional test job (#4575) 654fe926 Introduce `get_python_state_dict()` for Python 3.12 compatibility. (#4570) 1e8b52a9 bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 66f12df0 chore: make #4587 use proper cpp17 feature macro (#4592) 5bbcba54 use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587) 286873ec chore(deps): bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#4584) cf7d2e6f Change `always_forkserver_on_unix()` to `use_multiprocessing_forkserver_on_linux()` (#4577) c4c15d4b docs: changelog for 2.10.4 (#4532) 04ef4e42 chore(deps): bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (#4576) 442261da Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) cbb876cc chore(deps): update pre-commit hooks (#4552) 3cc7e425 add --version option to pybind11-config (#4526) 438034c5 chore: move to Ruff and add rules (#4483) a19daeac Inconsistent comments between 2 templates of `unchecked()`. (#4519) 68211d41 fix: nicer stack level for warning (#4516) 6a5e6007 Make warning suppressions MINGW-specific again. (#4515) d1956eab Appease new flake8 B028 error: (#4513) 08a4a47a Revert "Go back to CMake 3.25.2 (#4496)" (#4503) 535f81a1 fix: tests dir has started to show up in packaging (#4510) 8dcced29 Always display python type information in cast errors (#4463) 531144dd Replace "whitelist" with "allowlist" (#4506) b8f28551 Go back to CMake 3.25.2 (#4496) f8713ec4 Revert "bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486)" (#4501) 8a90b367 chore(deps): update pre-commit hooks (#4495) b2c1978c bugfix: Keep registered types until after Py_Finalize(). Fix #4459 (#4486) 9ef65cee chore(deps): bump ilammy/msvc-dev-cmd from 1.12.0 to 1.12.1 (#4493) 08a89fac bugfix: delete proper ctors in gil.h (#4490) 3efe9d4c chore: update to black 23 (#4482) 44e93682 Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig (#4473) c71e3af7 Bump isort version to 5.12.0 (#4480) a500f439 Resolve new flake8 error (#4462) c709d2a8 Make sure to properly untrack gc objects before freeing them (#4461) e53d58af Ensure `import pybind11_tests` traceback is shown. (#4455) d821788b Add clang15 C++20 job (#4443) a34596bf chore: back to work b2d7ad72 chore: prepare for 2.10.3 (#4437) 769fd3b8 chore(deps): update pre-commit hooks (#4439) e3e24f3f fix: issuses detected by static analyzer (#4440) 6da268a5 ci: remove clang 10 C++20 (it broke recently) (#4438) f12e098f Fix `detail::obj_class_name()` to work correctly for meta classes. (#4436) 60f02f5f fix: improve the error reporting for inc_ref GIL failures (#4427) 70af9873 docs: fixed typo in spelling of first (#4428) 7f23e9f3 chore: update clang-tidy to 15 (#4387) 0694ec6a chore: preapre for 2.10.2 release (#4414) 3fd1520d docs: changelog for next version (#4413) ee4b9f5d Fix ODR violations in our Eigen Tensor tests (#4412) a97c4d22 fix(cmake): support Windows ARM cross-compilation (#4406) 09db6445 IPO/LTO support for ICX (IntelLLVM) compiler (#4402) ece1206b ci: set `env: VERBOSE: 1` (#4405) 89c3561d Fix multi-context new Python linking mode (#4401) ff42f525 Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (#4398) 9727dcda chore: future safe bugbear opinionated warnings (#4393) 663b86c2 Add flake8 `B905` to `extend-ignore` in setup.cfg (#4391) 9db98801 Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 00126859 Add option for enable/disable enum members in docstring. (#2768) 65374c8e `pybind11::handle` `inc_ref()` & `dec_ref()` `PyGILState_Check()` **excluding** `nullptr` (#4246) 65cc9d2a chore(deps): bump pypa/gh-action-pypi-publish from 1.6.1 to 1.6.4 (#4389) 4768a6f8 chore(deps): update pre-commit hooks (#4386) a672de7c Fix source comment typo (#4388) a6e75e4d chore(deps): bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.1 (#4384) 6a1023e3 chore(deps): bump deadsnakes/action from 2.1.1 to 3.0.0 (#4383) 5b55f8fe Replace `ubuntu-latest` with `ubuntu-22.04` (#4382) e133c33d chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 358ba459 Fix test added with PR #4330 (#4372) b14d58b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#4370) 88699849 scoped_interpreter. overloaded constructor: PyConfig param (#4330) 06003e82 Introduce a new style of warning suppression based on push/pop (#4285) 9907bedc fix(.github): fix bug-report issue template (#4363) 9c18a74e Use `multiprocessing` `start_method` `"forkserver"` (#4306) 48949222 Use `PyEval_InitThreads()` as intended (#4350) 296615ad Add macos_brew_install_llvm to ci.yml (#4326) 88b019a8 fix pybind11Tools.cmake typo causing Unknown arguments (#4327) 1f04cc70 Add windows_clang to ci.yml (#4323) ee2b5226 Fix functional.h bug + introduce test to verify that it is fixed (#4254) 0176632e chore: sync blacken-docs hook with black (#4304) 2441d25b chore(deps): update pre-commit hooks (#4302) 252ed8fb docs: prepare for 2.10.1 release (#4279) b1bd7f26 fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) 3a2c96bd fix: unicode surrogate character in Python exception message. (#4297) 5bc0943e Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) b07d08f6 Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216) b07223fa fix: improve bytes to str decoding error handling (#4294) fcb5554d ci: move to final release of 3.11 (#4286) 07a61aa1 Fix char8_t support (#4278) d1c31e9a chore: improve issue template (#4276) 4fe905d4 fix: add flag for overriding classic Python search values (#4195) 8ea75ab4 Fix casts to void* (#4275) 17c1e27b fix: Revert pfect args make iterator (#4234) 91cfb770 Revert "feat: add entrypoint for cmake modules dir" (#4270) 2ce76f78 Cleanup casters to release none() to avoid ref counting (#4269) 36ccb08b docs: update changelog (#4265) 128d988e ci: fix labeler 1d4a65e2 feat: add entrypoint for cmake modules dir (#4258) c3854682 ci(fix): don't label weekly dep updates & ci fixes (#4264) 17c68091 ci: update PGI build (old one no longer signed) (#4260) fab1eebe First draft of Eigen::Tensor support (#4201) b926396b bugfix: py contains raises errors when appropiate (#4209) 5b5547bc chore(deps): bump ilammy/msvc-dev-cmd from 1.11.0 to 1.12.0 (#4242) 964c4997 Minor `py::capsule` cleanup. No functional change. (#4238) 8781daf6 chore: Optimize iterator advance() call (#4237) 0927c4d1 chore: Improve PyCapsule exception handling (#4232) ff7b6971 chore(deps): bump jwlawson/actions-setup-cmake from 1.12 to 1.13 (#4233) da104a9e Reproducer and fix for issue encountered in smart_holder update. (#4228) 7c6f2f80 fix: PyCapsule_GetDestructor is allowed to return a nullptr destructor (#4221) 4a421562 test_eigen.py test_nonunit_stride_to_python bug fix (ASAN failure) (#4217) 6cb21474 fix: NVCC 11.4.0 - 11.8.0 host bug workaround (#4220) 864ed112 chore: steal arg_v.value from copied arg in unpacking_collector (#4219) 8275b769 ci: update pre-commit schedule (#4212) 600d6976 [pre-commit.ci] pre-commit autoupdate (#4210) c78dfe69 bugfix: Add error checking to list append and insert (#4208) da8c730a [pre-commit.ci] pre-commit autoupdate (#4197) 5aa0fad5 perf: call reserve method in set and map casters (#4194) f743bdf8 Avoid local_internals destruction (#4192) 95d0e71a test C++14 on MSVC (#4191) 424ac4fe fix: Windows compiler, missing object initializer (#4188) d02f219f [pre-commit.ci] pre-commit autoupdate (#4189) 9c04c7b0 chore: Delete copy ctor/assign for GIL RAIIs (#4183) 1874f8fa Clarify GIL documentation (#4057) 8524b20c fix: Python-3.12 compatibility (#4168) 64f72818 [pre-commit.ci] pre-commit autoupdate (#4178) aa8f8baa [pre-commit.ci] pre-commit autoupdate (#4171) 8756f16e [pre-commit.ci] pre-commit autoupdate (#4151) 283f10dc chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) 0b4c1bc2 test: ConstructorStats newline (PyPy) (#4167) fac23b6f `error_fetch_and_normalize`: PyPy 7.3.10+ does not need the PR #4079 workaround anymore. (#4154) a48ec3e8 Words matter updates (#4155) 68e6fdaa embed.h Python 3.11 `config.use_environment=1` + `PYTHONPATH` test (#4119) 81f35d29 chore: Mark detail:forward_like as constexpr (#4147) 2d59b43c Qualify detail::forward_like to avoid conflict. (#4136) b884b9dc chore: Add pytests for constructing pytypes from iterable (#4138) bbb89da1 fix(cmake): support vcpkg, try 2 (#4123) 5bdd3d59 feat(cmake): add installation support for pkg-config dependency detection (#4077) 14c84654 [pre-commit.ci] pre-commit autoupdate (#4126) 6abb7de6 chore: Use PyObject_GenericGetDict and PyObject_GenericSetDict functions (#4106) 8a4bca82 fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 29f4940c Fix copy-paste oversight (#4118) ba5ccd84 [pre-commit.ci] pre-commit autoupdate (#4104) 88a1bb92 chore: remove unnecessary temporary std::pair (#4103) f8e8403b Open pybind11 namespace with consistent visility. (#4098) aa953710 [pre-commit.ci] pre-commit autoupdate (#4090) 36655302 Add `-DPYBIND11_WERROR=ON` to mingw cmake commands (#4073) 1e3400b6 chore(deps): bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 (#4091) d70f54b0 docs: Missing semicolons (#4094) b07975f4 Fix missing undef in pytypes (#4087) 9a296373 More systematic gcc & clang coverage (#4083) cb35a3c1 For PyPy only, re-enable old behavior (runs the risk of masking bugs) (#4079) 42b54507 chore: use explicit defaulting in pyobject macros (#4017) f47f1edf Fix #3812 and fix const of inplace assignments (#4065) ef7d971e [pre-commit.ci] pre-commit autoupdate (#4082) 59f03ee3 tests: include pypy3.9 in nox if present 5116a629 fix(spelling): PYTHON_VERSIONS 8d82f298 chore: back to work aa304c9c chore: preapre for 2.10.0 release (#4068) 87f64c43 docs: update changelog for 2.10.0 (#4066) 1d811910 Disable implicit conversion of `0` to `pybind11::handle`. (#4008) bc9315fe chore: optimize sparse matrix casting with python tuple (#4064) 6b60d97d docs: use Furo (#3109) 7c3a0317 chore: bump clang-tidy to 13 (#3997) 023b3f32 Undo accidental one-line change under PR #3913 (#4060) 790241bc [pre-commit.ci] pre-commit autoupdate (#4058) f9f00495 Properly visit self in >=3.9 traverse (#4051) 432bc5cf Add `std::string clean_type_id(const char *typeid_name)` overload (in namespace detail). (#4049) 85bc0884 Report `C++ Info:` via `pytest_report_header()` (#4046) cd08869d PYBIND11_NAMESPACE consistency fixes. (#4043) 0ab1fcfb docs: update changelog (#4042) 2af163d9 Fix: 3.11 beta support (#3923) c42e3ab7 [pre-commit.ci] pre-commit autoupdate (#4041) bc1f9f9b chore(deps): bump actions/setup-python from 3 to 4 (#3999) 5a3a1e34 chore: simpler dependabot (#4035) 479e9a50 Fix arrays with zero-size dimensions (#4038) 374a5b00 [docs] Fix "Enumerations and internal types" example (#4034) dd3bf7fd [pre-commit.ci] pre-commit autoupdate (#4030) c3e9173f ci: use almalinux instead of centos, add 9 (#4020) 2ad974c9 [pre-commit.ci] pre-commit autoupdate (#4021) 0964a909 Add a missing std::move in numpy.h (#4005) 21f0e72b [pre-commit.ci] pre-commit autoupdate (#4003) 0e956a2e chore(deps): bump pre-commit/action from 2.0.3 to 3.0.0 (#3992) e2dcd954 chore: optimize dictionary access in strip_padding numpy (#3994) 918892b9 Make dtype::num() return type consistent with other functions (#3995) c5fa3436 [pre-commit.ci] pre-commit autoupdate (#3951) 554c0453 enable two new clang-tidy checks (#3988) 42a41bf3 remove useless ctor (#3989) a05bc3d2 error_already_set::what() is now constructed lazily (#1895) 58802de4 perf: Add object rvalue overload for accessors. Enables reference stealing (#3970) 9f7b3f73 addl unit tests for PR #3970 (#3977) b24c5ed2 Replace "Unknown internal error occurred" with a more helpful message. (#3982) de4ba92c Add `error_scope` to `detail::get_internals()` (#3981) 8da58da5 chore: perfectly forward all make_iterator args (#3980) 748ae227 Add missing error handling to `module_::def_submodule` (#3973) 68f80105 chore: add err guard to capsule destructor and add a move to iostream (#3958) 8d14e666 fix: avoid `catch (...)` for expected `import numpy` failures (#3974) 2c549eb7 Move `PyErr_NormalizeException()` up a few lines (#3971) 2d4a20c8 chore: add missing moves for buffer_func and staticmethod in pybind11.h (#3969) 4624e8e1 Don't return pointers to static objects with return_value_policy::take_ownership. (#3946) c42414db (perf): use a rvalue cast in func_wrapper (#3966) 918d4481 fix(cmake): support cross-compiles with classic Python (#3959) 1e4bd22b fix(cmake): support release and debug at the same time (#3948) a8b3ff30 chore: add a couple of moves in pybind11.h (#3941) dff6fa05 fix(cmake): avoid issue with NVCC + Windows (#3947) 1a7b1298 ci: fix cuda issue & MSVC spurious warning (#3950) 72eea20a Fix py::cast from pytype rvalue to pytype (#3949) 48c7be4a Undoing previous accidental commit. Sorry I forgot to git branch. 5621ab85 Do we have a unit test for the traceback code in error_string()? ad146b2a [pre-commit.ci] pre-commit autoupdate (#3933) 2e331308 chore: remove unused include from stl.h (#3928) 68a0b2df Add anyset & frozenset, enable copying (cast) to std::set (#3901) 9a16e55a [pre-commit.ci] pre-commit autoupdate (#3903) f306012b fix: file extension on windows with cp36 and cp37 (#3919) bdc7dd8c chore: update NVIDIA-PGI CI workflow (#3922) 287e4f23 Test pickling a simple callable (does not work). (#3906) f0b9f755 Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 75007dda chore: rule of 3 for strdup guard (#3905) 9bc27044 Add tests for cast from tuple to sequence containers (#3900) 03252067 chore(deps): bump actions/upload-artifact from 2 to 3 (#3899) be4a634c chore(deps): bump actions/checkout from 2 to 3 (#3896) 82455a41 Minor opt to cache tuple casting (#3894) 2a7cb008 chore(deps): bump actions/download-artifact from 2 to 3 (#3897) e79293cf chore(deps): bump actions/cache from 2 to 3 (#3898) b58b772b chore(deps): bump actions/setup-python from 2 to 3 (#3895) 1a8603e4 ci: dependabot major versions for official actions (#3888) e8e229fa [pre-commit.ci] pre-commit autoupdate (#3885) 1c636f4d chore: Change numpy dtype from_args call sig to const ref (#3878) fbcde3f0 chore: enable clang-tidy check modernize-use-nullptr (#3881) 30716c67 Also add error_scope assignment operator to complete the rule-of-3 (follow-on to PR #3870). (#3872) 3829b762 chore: simplify numpy dtype ctor (#3869) 45164c1f Added deleted copy constructor for error_scope to comply with rule of 3. (#3870) ba7a0fac Expand dtype accessors (#3868) fa98804a Adds set_name method of pybind11::capsule class (#3866) ad0de0f5 [pre-commit.ci] pre-commit autoupdate (#3863) 9969f3b5 ci: drop win2016 (#3854) 088ad4f2 Cleanup cast_safe<void> specialization (#3861) e3aa215b Add perfect forwarding to make_iterator calls (#3860) 1b27b744 chore: Make stl_bind take slice as const_ref (#3852) ab59f45d Prefer make_caster<T> to type_caster<T> (#3859) c4e29528 perf: Add more moves and optimize (#3845) f2f0c690 [pre-commit.ci] pre-commit autoupdate (#3848) b3ebd11d feature: support compilers that use std::experimental::filesystem (#3840) 65ec5de5 chore: bump changelog for 2.9.2 (#3834) 42d8593a style: bump black (#3831) 3a183d4b fix: improve str exceptions and consistency with python (#3826) 7742be02 Revert "ci: test pypy 3.9" (#3828) 461937d3 ci: test pypy 3.9 (#3789) 146695a9 fix: better exception and error handling for capsules (#3825) 47079b9e (perf): Add missing move in sp matrix caster and microopt char concats (#3823) b22ee64c Add type_caster<std::monostate> (#3818) 67089cd3 [pre-commit.ci] pre-commit autoupdate (#3817) b3a43d13 Use rvalue reference for std::variant cast_op<T> (#3811) 8b1944d3 Remove idioms in code comments (#3809) a7e7a6e8 Docs: No Strip in Debug (#3779) f8a532a7 [pre-commit.ci] pre-commit autoupdate (#3800) 91a6e129 PYBIND11_OBJECT_CVT should use namespace for error_already_set() (#3797) d75b3536 CI: MSVC Debug Build (#3784) 2dd52544 fix: missing move in eval.h (#3775) af08a95b fix: potential memory leak in pypy (#3774) 42a8e312 Improve Python 3.11 support (#3694) 465b2e0b Use sysconfig in Python >= 3.10 (#3764) 5f9b090a ci: fix PyPy (#3768) 061c6177 [pre-commit.ci] pre-commit autoupdate (#3765) f495dfc4 cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) da15bb20 Cast bytearray to string (#3707) 91f597be [pre-commit.ci] pre-commit autoupdate (#3754) 9aa676d3 fix: clear local internals after finalizing interpreter #2101 (#3744) 44596bc4 Fix exception handling when pybind11::weakref() fails. (#3739) 009ffc33 MSVC C++20 test_eigen (#3741) 4b42c371 style: pylint (#3720) c14170a7 Removing `// clang-format off` - `on` directives from test_pickling.cpp (#3738) 0986af61 [pre-commit.ci] pre-commit autoupdate (#3672) a25d40c7 tests: use 'build' in tests instead of running setup.py (#3734) a97e9d8c Dropping MSVC 2015 (#3722) 44156477 Adding MSVC 2022 C++20 GitHub Action (#3732) 522c59ce chore: drop Python 3.5 (#3719) 1a432b42 docs: Correct minor typos (#3721) 6493f496 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 46dcd9bc fix: minor CMake warning fix for unused variable (#3718) ec24786e Fully-automatic clang-format with include reordering (#3713) e96221be Final manual curation in preparation for global `clang-format`ing (#3712) d6c66d25 chore(clang-tidy): Add clang-tidy rules: prefer-member-initializer and optin.performance.Padding (#3716) dc9803ce Add missing clang-tidy fixes (#3715) 7f975816 chore(clang-tidy): Enable static downcast and decl naming check (#3709) abc38690 Manually applying two clang-format changes that need fix-ups for clang-tidy. (#3705) 7769e771 clang-tidy readability-qualified-auto (#3702) b4f5350d chore: use member initializer (#3704) ddbc74c6 Adding .clang-tidy readability-braces-around-statements option. 8581584e Manual fix-ups in preparation for clang-tidy readability-braces-around-statements. af056b65 fix: __index__ on Enum should always be present. (#3700) 1b841883 Minor change to improve readability (#3695) 96b943be tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679) 94a94872 docs: fix imported target name (#3689) 36813cfa chore: back to work 1d3b04e8 test: Strip whitespace when comparing numpy dtypes for 1.22 compat (#3682) ffa34686 chore: bump to 2.9.1 3899dc65 Documenting missing unit test coverage. (#3673) 0f6ad910 docs: update changelog for 2.9.1 (#3670) 21e10945 ci: move centos 8 to stream (#3675) ce18721d Ensure TypeError use raise_from for C++->Python overload res. (#3671) 978617f6 fix issue 3668 by removing bool casts in numpy.h (#3669) 3a8d9230 Fix caster optimization regression introduced in #3650 (#3659) bf7e5f92 fix(setup): support overriding CMake args (#3577) dc4717ba fix: module extension detection for python 3.10 (#3663) 07103d65 Remove extra semicolon (#3666) 17792884 Document how to bind templates (#3665) ec81e8e7 Propagate py::multiple_inheritance to all children (#3650) bcb6d63c fix msys ci python issue (#3651) dedda228 Fix a typo in class.rst (#3648) 9ec1128c Fix typo in doc (#3628) 3a1eddab chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625) 51948559 Render `py::bool_` and `py::float_` without `_` in docstrings (#3622) 7e7c5585 Fixing obvious minor typo (missing `D` in `-DOWNLOAD_EIGEN=ON`). d2ec8367 Add support for nested C++11 exceptions (#3608) f8d4aa47 Add clang-tidy readability checks for sus args (#3611) 21911e12 A way to register additional test targets and support .py only tests. (#3590) d434b5f3 (chore): Remove deprecated c-headers (#3610) f5888108 Replacing ICC C++14 with C++17 (#3570) ef070f77 Add additional info to TypeError when C++->Python casting fails (#3605) b66328b0 [pre-commit.ci] pre-commit autoupdate (#3609) fb9a222d chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606) 2cd32e5d [pre-commit.ci] pre-commit autoupdate (#3589) 1bbaeb34 Adding dedicated test_const_name. (#3578) 9b4f71d1 docs: remove duplication in changelog for 2.9.0 93716147 Merge branch 'master' into stable 45f792ef chore: prepare for 2.9 89769e6e [pre-commit.ci] pre-commit autoupdate (#3574) cb302305 fix: restore full range of _ functions (#3571) d4b9f347 docs: update changelog (#3556) e50f841d fix: do not use LTS on mips64 and ppc64le (#3557) 39fbc799 fix: avoiding usage of _ if already defined (#3423) b3d9c354 vi: replacing currently broken ICC Latest C++17 with C++14. (#3551) d0406c74 [pre-commit.ci] pre-commit autoupdate (#3563) 75168113 fix(setup_helpers): ensure ThreadPool is closed (#3548) 59aa9986 [pre-commit.ci] pre-commit autoupdate (#3533) a224d0cc fix: vs2022 compilation, issue #3477 (#3497) b4939fcb Expand std::string_view support to str, bytes, memoryview (#3521) cd176cee chore: update changelog with recent PRs (#3524) 70a58c57 Replace usage of deprecated Eigen class MappedSparseMatrix. (#3499) fe65693c [pre-commit.ci] pre-commit autoupdate (#3500) 5d067e87 fix: remove redundant copy operation to fix warning (#3486) 9281faf4 Fixing `stict` vs `strict` typo. (#3493) 673b4be3 Fix py::kw_only when used before the first arg of a method (#3488) 56322daf fixed include for filesystem::path (#3482) 15f8d7c1 fix(build): cleaner CMake printouts & IDE folders (#3479) ff51fcb7 docs: fix broken link (again) 72282f75 ci: support development releases of Python (#3419) 1eb59963 Removed duplicated word in docs/advanced/exceptions.rst (#3476) d2b21316 cmake: report version type in the version string (#3472) 9422d98f [pre-commit.ci] pre-commit autoupdate (#3473) afdc09de [master] Wrong caching of overrides (#3465) 270b11d5 Revert "style: drop pycln" (#3466) e450eb62 Removed duplicated word in docs/advanced/cast/eigen.rst (#3458) aebd21b5 docs: rework CI a bit, more modern skipping (#3424) b11ff912 fix(setup =_helpers): don't add -g0 CFLAGS sets -g (#3436) b322018e [pre-commit.ci] pre-commit autoupdate (#3449) 01f938e7 fix: add missing std::forward calls (#3443) a61e354e docs: touch up manual release suggestion (#3422) 6de30d31 [pre-commit.ci] pre-commit autoupdate (#3432) dd2d1272 Correct "which" versus "that" error. (#3430) e7c9753f feat: allow kw-only args after a py::args (#3402) a80b2237 chore: get back to work after 2.8.1 acae9301 Merge branch 'master' into stable f7b49961 [skip ci] Tweaks in preparation for the 2.8.1 release. (#3421) f1594cb9 docs: changelog update for 2.8.1 (#3416) 90707b46 fix(build): support conan's multiple includes of all files (#3420) e7e2c79f fix: improve support for Python 3.11-dev (#3368) c2d3e220 fix: the types for return_value_policy_override in optional_caster (#3376) d45a8810 [pre-commit.ci] pre-commit autoupdate (#3409) 9379b399 fix: MSVC 2017 C++17 on Python 3 regression (#3407) 78ee782b feat: Add C++ binding to throw AttributeError (#3387) 076c89fc tests: test recursive dispatch using visitor pattern (#3365) 606f81a9 style: drop pycln (#3397) 2d6014e4 docs: fix minor typo (#3390) f791dc86 fix: deprecate make_simple_namespace, fix Python 3.11 (#3374) 931f6644 ci: cancel in-progress on repeated pushes (#3370) 56b49c2b ci: fix mingw checks by pinning (#3375) 7c580586 Correct options on Eigen::MappedSparseMatrix & adding MSVC C4127 suppression around Eigen includes. (#3352) 02c05573 [pre-commit.ci] pre-commit autoupdate (#3353) 8a7c266d Fix make_key_iterator/make_value_iterator for prvalue iterators (#3348) 750e38dc Update eval.h (#3344) f4c81e08 maint: Add additional linter-related pre-commit hooks (#3337) ed09664f chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338) 47ed124f Fix some formatting in the v2.8.0 changelog (#3339) ba9f919b chore: get back to work after 2.8.0 e315e1fe Merge branch 'master' into stable 97976c16 [pre-commit.ci] pre-commit autoupdate (#3325) 3747dc2c Revert "All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage)." (#3326) c9a319c6 chore: version 2.8.0 final 20aae3e6 ci: disable Eigen due to Cert issue on CentOS 591db0b9 docs: update CHANGELOG for 2.8 9f146a56 All `-DDOWNLOAD_EIGEN=OFF` (to work around gitlab eigen outage). d7a7edc1 tests: support Eigen configuration ad966556 fix: replace free() with std::free() (#3321) b3573ac9 feat: add `.keys` and `.values` to bind_map (#3310) b4e1ab8c Docs: Demonstrate non-enum internal types in example (#3314) a1830d5e docs: mention title conventions in PR template (#3313) c9bbf8d2 docs: fix minor typo (#3311) 71fd5241 docs: fix minor typo (#3311) 6be64304 [pre-commit.ci] pre-commit autoupdate (#3312) 6bce3bd7 docs: update CHANGELOG (#3304) d58699c9 fix(cmake): reduce chance for variable collision (#3302) 62c4909c Add `custom_type_setup` attribute (#3287) 409be833 CMake: react to python version changes 6ad3f874 fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 21282e64 feat: reapply fixed version of #3271 (#3293) 2a78abff Ensure PYBIND11_TLS_REPLACE_VALUE evaluates its arguments only once (#3290) 5f46e47d tests: check simple iteration of pairs (#3296) 2fa3fcfd Revert "Add make_value_iterator (#3271)" 1dc9a23c chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294) b06a6f4f feat: Slice allowing None with py::object or std::optional (#1101) 0fb981b2 Add blacken-docs and pycln pre-commit hooks (#3292) ee0c5ee4 Add make_value_iterator (#3271) 077a16e9 [pre-commit.ci] pre-commit autoupdate (#3286) 6e6975e2 Fix test case with __new__ (#3285) d0f3c51f Enable defining custom __new__ (#3265) 14976c85 Eliminate duplicate TLS keys for loader_life_support stack (#3275) 04dd3262 docs: update CHANGELOG (#3276) e0031bfc include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable (#3270) 3ed31e92 [pre-commit.ci] pre-commit autoupdate (#3266) 6c65ab59 Follow-on to PR #3254, to address user code breakages. (#3263) 9978ed58 Fix capsule bug (#3261) 0e599589 Fix thread safety for pybind11 loader_life_support (#3237) 121b91f9 Fixing NOLINT mishap (#3260) ae07d4c6 maint(Clang-Tidy): readability-const-return (#3254) 4d5ad03e Avoid use of temporary `bytes` object in string_caster for UTF-8 (#3257) 4c6bee35 fix: Set __file__ constant when using eval_file (#1300) (#3233) 6abf2baa CodeHealth: Enabling clang-tidy google-explicit-constructor (#3250) 39a0aac8 docs fix to avoid nonexistent SmartCompile (#3241) d71ba0cb (perf): Add a missing noexcept to a pytype constructor (#3236) 49173e47 Minor follow-on to PR #1334 (Fix enum value's __int__ returning non-int when underlying type is bool or of char type) (#3232) a46f6237 Minor tweaks. (#3230) d6474ed7 fix: memory leak in cpp_function (#3228) (#3229) 76d939de [pre-commit.ci] pre-commit autoupdate (#3231) 777352fc Adding `ssize_t_cast` to support passing `size_t` or `ssize_t` values where `ssize_t` is needed. (#3219) cb60ed49 Fix enum value's __int__ returning non-int when underlying type is bool or of char type (#1334) 930bb16c Call PySys_SetArgv when initializing interpreter. (#2341) 503ff2a6 view for numpy arrays (#987) db44afa3 tests: fix pytest usage on Python 3.10 (#3221) 59ad1e7d reshape for numpy arrays (#984) 031a700d Add make_simple_namespace function and tests (#2840) c8ce4b8d Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 6cbabc4b maint(clang-tidy): Enable cpp-coreguideline slicing checks (#3210) fdac5fbf chore: support targeting different Python versions with nox (#3214) b3d18f38 [pre-commit.ci] pre-commit autoupdate (#3213) 4f29b8a4 ci: extend msys2 mingw CI (#3207) 998d45e4 Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 774b5ff9 Removing obsolete eigen.h warning suppression pragmas. (#3198) 617cb653 [Bugfix] Fix errant const methods (#3194) 1bcd94c4 Removing last remnants of pragma block at the top of pybind11.h (#3186) 9df2f1ff maint(precommit): Apply isort (#3195) d6841f60 chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196) 7d3b0571 Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193) 0be2ea06 [pre-commit.ci] pre-commit autoupdate (#3185) 4c7e509f PYBIND11_NOINLINE-related cleanup. (#3179) ff590c12 maint(perf): Optimize Numpy constructor to remove copies by value. (#3183) 61ee923b Consistent step name "Python tests". (#3180) 6ac8efe5 test_eval: Show example of working closure (#2743) af700733 Removing GCC -Wunused-but-set-parameter from pragma block at the top of pybind11.h (#3164) 3893f37b maint(clang-tidy): Bugprone enable checks (#3166) 089328f7 Revert "fix: apply simpler expression with fewer workarounds" 1fafd1b4 fix: apply simpler expression with fewer workarounds 5f4d7259 fix: version number hex c30f57d2 chore: start development for 2.8.0 787d2c88 fix: include hex version in bump 82adacb3 fix: include hex version in bump 5f34c42d chore: bump to version 2.7.1 078c1167 chore: bump to version 2.7.1 90959848 chore: changelog update (#3163) 9f204a18 fix: func_handle for rule of two (#3169) ada6b791 [pre-commit.ci] pre-commit autoupdate (#3167) a2b78a8c chore: changelog update (#3163) c0756ccd fix: func_handle for rule of two (#3169) f4f4632e [pre-commit.ci] pre-commit autoupdate (#3167) dcbda8d7 Removing MSVC C4127 from pragma block at the top of pybind11.h (#3152) b961ac64 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) c80e0593 fix: Mingw64 corrected and add a CI job to test it (#3132) 46c51fc0 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) e2573dc9 Moving pragma for MSVC warning C4505 from pybind11.h to existing list in detail/common.h (#3160) 9e8a741b fix: Mingw64 corrected and add a CI job to test it (#3132) b4259729 Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. (#3161) b1fdbe69 chore: add discussions link (#3159) 05852fb6 Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) ed5fb66b Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 0ac4c8af maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 5c6bdb72 fix: the CMake config in Python package had a hard coded path (#3144) fd71bd48 Allow python builtins to be used as callbacks (#1413) e93d9459 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) c973660d [pre-commit.ci] pre-commit autoupdate (#3143) 85b38c69 Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) b193d42c Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) ee3ecb8a Specified encoding in setup.py calls of open() (#3137) c14b1933 chore: increase CMake upper limit (#3124) b72ca7d1 Removing MSVC C4100 from pragma block at the top of pybind11.h (#3150) f4721a7b Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (#3151) 2164c2e0 Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 9beaa925 maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 7cc0ebb4 fix: the CMake config in Python package had a hard coded path (#3144) a0b97596 Allow python builtins to be used as callbacks (#1413) a0f862d4 Removing MSVC C4800 from pragma block at the top of pybind11.h (#3141) 7f76d795 [pre-commit.ci] pre-commit autoupdate (#3143) 7904ba1a Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142) ff97f101 Removing MSVC C4996 from pragma block at the top of pybind11.h (#3129) e58c6897 Specified encoding in setup.py calls of open() (#3137) d65edfb0 Feature/local exception translator (#2650) 6d5d4e73 Move object in pop method of List. (#3116) 9626483c [pre-commit.ci] pre-commit autoupdate (#3134) 34f587dd Removing all warning pragmas that have not effect. (#3127) 74935f8d chore: post-release (#3128) 65e95ea8 chore: bump to 2.7.0 (#3123) 6642f389 docs: update changelog (#3122) 4359e00b Introducing PYBIND11_VERSION_HEX (#3120) 1b10292c chore: support PDF from nox (#3121) 55f6f6e9 Fix: RTD Docutils Build (#3119) 2415c094 feat(package): support pipx run (#3117) 31843d45 docs: reduce visibility of 3.9.0 warning (#3105) 5cd37507 Enable -Wstrict-aliasing warning (#2816) c4b0dc7c Add shellcheck style checking (#3114) cd061aee style: pre-commit cleanup (#3111) 7331d381 Raise codec errors when casting to std::string (#2903) aca6c3ba * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 1be0a0a6 Add helper to build in-tree extensions. (#2831) 2b7985e5 Improve documentation of discard_as_unraisable() API (#2697) 25e470c5 fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 6a644c8f docs: update changelog (#3099) 0e2e0035 style: add pyupgrade check, 2.7+ 11e12fe4 chore: move some config to pyproject.toml 84fdadfb chore: update pre-commit hooks 75090647 More precise return_value_policy::automatic documentation. (#2920) ddf0efb9 chore: add nox support (#3101) 9f11951b Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) f0a65c89 docs(fix): spelling mistake in recent commit 7472d37a Adding iostream.h thread-safety documentation. (#2995) 2d468697 NOLINT reduction (#3096) 7a64b8ad docs: fix script issues for changelog compilation (#3100) 0f4761b4 Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) cf006af2 Fix typos and docs style (#3088) bac5a0c3 Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) b5357d1f fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080) 6d1b197b Splitting out pybind11/stl/filesystem.h. (#3077) c090c8c4 Unify cast_error message thrown by [simple|unpacking]_collector (#3013) 0ad116d3 Adding codespell to .pre-commit-config.yaml (follow-on to PR #3075). (#3076) 8bee61b6 docs: fix various typos (#3075) 795e3c4c Removing `AlignConsecutiveAssignments: true`. (#3067) 6d440946 Check dict item accesses where it isn't already checked (#2863) 5bcaaa04 Add a std::filesystem::path <-> os.PathLike caster. (#2730) f067deb5 avoid unnecessary strlen (#3058) 733f8de2 Avoid string copy if possible when passing a Python object to std::ostream (#3042) cad79c11 tests: remove very minor oversight in PR #3059. (#3066) fbae8f31 pickle setstate: setattr __dict__ only if not empty (#2972) 93e69191 fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059) 484b0f04 Updating and slightly enhancing instructions for running clang-tidy. (#3055) dac74ebd fix(clang-tidy): performance fixes applied in tests and CI (#3051) 3b30b0a5 fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) d00fc629 use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 9b3b3577 chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) e0b5cbd4 chore(clang-tidy): add more modernize clang-tidy checks (#3049) af6218ff fix(clang-tidy): Apply performance fixes from clang-tidy (#3046) 79178e71 fix(setup_helpers): try import multiprocessing.synchronize too (#3043) 19d99a87 Working around Centos 8 failure. (#3030) b4b67f02 Fix typos (#3044) cd4b49a2 Update py::kwargs examples to pass by reference (#3038) 4c7697db Add const T to docstring generation. (#3020) e25b1505 Adjusting valgrind suppression for pypocketfft to resolve systematic failures that started to appear on 2020-05-27. (#3022) 3ac690b8 Explicitly export exception types. (#2999) 14023c9c chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) f61855b9 chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) bc7cf6ef chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) b6ec0e95 functions: Add doc on incorrect argument index (#2979) 417fd120 Fix: fix typo of WITHOUT_SOABI (#2992) 0c93a0f3 Fix Unicode support for ostream redirects (#2982) 54430436 ci: install Boost for boost checks (#2968) bca4b36b chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964) 5e4804bb tests: use master commit for pytest on 3.10 (#2967) e08a5811 Fix compilation with gcc < 5 (#2956) 114be7f4 docs: remove recommonmark (#2955) 62976cfc fix: using -Werror-all for Intel (#2948) 6709abba Allow function pointer extraction from overloaded functions (#2944) e0c1dadb chore: add myself to CODEOWNERS (#2940) 4f0727f2 Fix the enabling of default extension handling (#2938) 16c23fef chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) ad6bf5cd Adding PyGILState_Check() in object_api<>::operator(). (#2919) f676782b env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 1259db6f Fix Pybind11Extension on mingw64 (#2921) c2db53da fix: catch missing self argument in overloads constructor (#2914) 3df0ee6f docs: typo in classes.rst (#2926) 0e01c243 Generalizing suppression for pypocketfft. (#2896) f110889d Use correct duration representation when casting from datetime.timdelta to std::chrono::duration (#2870) 44678e54 Shuffling code in test_multiple_inheritance.cpp to separate struct/class definitions from bindings code. (#2890) 9c0aa699 Pointing out namespace in docs (#2874) e2e819b2 Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. Back-porting from smart_holder branch, to minimize diffs and potential for merge conflicts. (#2875) 74a767d4 Dtype kind vs char (#2864) c0fbb02c Extract gil management functions to separate header (#2845) 0c42250a Splitting out detail/type_caster_base.h from cast.h, with iwyu cleanup. (#2841) 98f9a33c Correct typo in FAQ (#2868) 59f8d7f1 chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 417067ee Add pybind11::bytearray (#2799) cbae6d55 docs: fix CMake status for DOWNLOAD_EIGEN (#2857) c2362393 chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851) c78dfb69 MSVC but not Clang: /MP (#2824) e791ec4e fix: add null pointer check with std::localtime (#2846) 948d09d6 test: Test against Python 3.10 (#2848) fe845878 Make sure all warnings in pytest get turned into errors (#2838) 721834b4 chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 6cf6bf20 Fix confusing weakref constructor overload (#2832) 932769b0 Adding holder_caster `typename SFINAE = void` hooks to help work around the current lack of smart-pointer interoperability (#2833) 23c3edcf When determining if a shared_ptr already exists, use a test on the we… (#2819) 0432ae7c Changing pybind11::str to exclusively hold PyUnicodeObject (#2409) 587d5f84 Update breathe to 4.26.1, add make_tuple, make_iterator, and make_key_iterator (#2828) 9b7bfef8 Factoring out find_registered_python_instance() from type_caster_generic::cast. (#2822) 87954e7a fix: corrected dev versioning 4a5b81b1 chore: get back to work 8de7772c chore: prepare for the 2.6.2 release (#2821) 732bf88d fix: avoid changing class outside of GIL dff9b3b4 chore: add pytest-timeout, mypy 8e5d3d23 docs: prepare for 2.6.2 (#2820) 42e73807 chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818) 0bb8ca26 Always call PyNumber_Index when casting from Python to a C++ integral type, also pre-3.8 (#2801) 9ea39dc3 Force the builtin module key to be the correct type. (#2814) 08bca374 docs: update changelog, nicer output for script (#2811) 44105ca1 docs: mention that the changelog block in PR is special 5b43ac42 docs: fix missing line from #2310 2db0264a style: add clang-format file (#2310) 130c9954 fix: support basic dual includes (#2804) eb83feef style: avoid using unintialized variables (#2806) 87f5aff4 ci: update to setup-cmake v1.6 (#2805) e8c4f543 fix: prepend Pybind11Extension flags rather than appending them. (#2808) 48534089 fix: Intel ICC C++17 compatibility (#2729) 8449a808 fix: only allow integer type_caster to call __int__ method when conversion is allowed; always call __index__ (#2698) 0df11d85 docs: update build description slightly (#2794) 0b3df7f9 ci: Intel icc/icpc via oneAPI (#2573) 0f8d5f2e Add a Valgrind build on debug Python 3.9 (#2746) 76a16007 fix: STATIC and SHARED flags not being detected (#2796) 08551463 Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 230fa53f fix: Don't override global settings for VISIBILITY if set (#2793) 1faf4a8a docs: the order of alternatives for variant types matters, and follows the same rules as overload resolution (#2784) 40931961 docs: fix spelling in some comments/docs (#2777) df8494dc fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780) 14b37512 docs: fix example code in Exceptions section (match vs. matches) (#2781) 210c8c21 fix: a warning found by static code analyzer (#2783) f243450e ci: disable builds for 3.10.0a4, and enable a nightly 3.10-dev build (#2792) 5abce7fc ci: use fixed action (#2791) 7b7ec664 ci: pin CMake to 3.19.2, fixes issues with 3.19.3 on Linux (aarch64) and macOS (universal) (#2790) 98f1bbb8 Ignore deprecation warnings about old-style __init__/__setstate__ constructors in the tests (originally done in #2746) (#2759) e57dd471 Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) e612043d Fix invalid access when reinterpret_casting a non-pybind11 PyObject* to instance* (found by Valgrind in #2746) (#2755) 2110d2d8 enum: add missing Enum.value property (#2739) b7dfe5cc chore: changelog update (#2750) d587a2fd fix: do not set docstring for function when empty (#2745) 830f8eda tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741) 6f66e760 docs: add a note about compiling the example (#2737) 635e3fc9 CONTRIBUTING: Add suggestion about passing pytest flags (#2738) 79b0e2c0 docs: fix pdf build, simpler start page (#2736) 6b4297fd fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735) 5bd766bf docs: update changelog and add script to help generate it (#2733) d5af536f ci: update cmake action (#2734) 79cb013f fix: allow users to avoid thread termination in scoped_released (#2657) cecdfadc minor cleanup: fixing or silencing flake8 errors (#2731) 30eb39ed fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701) d9fa7056 style: remove redundant instance->owned = true (#2723) ffb113d1 fix: regression with installed pybind11 overriding local one (#2716) 499fcd54 ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724) 5469c238 Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705) 91a69720 docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719) d068ab28 docs: pybind11/numpy.h does not require numpy at build time. (#2720) 028812ae docs: add warning about FindPython's Development component when libraries don't exist (e.g. on manylinux) (#2689) d57c1fab docs: update installing.rst (#2691) 8adef2c7 fix: workaround for #2682 and #2422 by simply clearing the TypeError (#2685) 087b07c8 Remove workaround code that is not needed since #1211 (#2683) 7bd4b397 fix: define PYBIND11_CPP14 for recent intel compilers (#2679) af8849f4 docs: list all pybind11 exceptions (#2671) 2fa4747c pythonbuf fix (#2675) 17c22b9e docs: mention branch update in checklist (#2670) 32d11c96 fix typo in pickle example (#2669) de78bddd docs: better badges (#2656) f8b8107b fix: make FindPython2 and FindPython3 work (#2662) 02746cb6 docs: add a little more information for releases b7c741b5 docs: back to work after 2.6.1 f1abf5d9 docs: changelog update (#2652) ebd5c5b4 feat: way to only recompile changed files (#2643) c58758d0 fix: add reasonable argument names to enum_ methods (#2637) b72cebeb style: clang-tidy: modernize-use-using (#2645) 06b673a0 Allow NULL value in pybind11_meta_setattro (#2629) 3e4d54bc fix: match new extension discovery with changes to classic discovery (#2640) 6d4854a5 ci: correct types statement 6cc233cc ci: label PRs when merged only for now b8dc60ec fix: Python include directory was missing from DIRS (#2636) 7d6713a4 Use weakref to clean up captured function object in def_buffer (#2634) 06a54018 fix: min macos (#2622) 139c05da ci: test on NumPy + Python 3.9 (#2628) 8290a5a0 clang -Wnon-virtual-dtor compatibility (#2626) f2e79986 [common.h] Mark another entry point as "unused". (#2625) 3a37d338 Add __builtins__ to globals argument of `py::exec` and `py::eval` if not present (#2616) ace4deb4 ci: add more jobs (#2610) 4d037439 fix: missing identifier for Python 3.9 7c26c718 Fix mispelling in basics.rst (#2614) 86d3e9eb begin working towards a future v2.6.1 patch release git-subtree-dir: examples/knxPython/pybind11 git-subtree-split: 941f45bcb51457884fa1afd6e24a67377d70f75c
2024-06-29 16:48:45 +02:00
Custom type setup
=================
For advanced use cases, such as enabling garbage collection support, you may
wish to directly manipulate the ``PyHeapTypeObject`` corresponding to a
``py::class_`` definition.
You can do that using ``py::custom_type_setup``:
.. code-block:: cpp
struct OwnsPythonObjects {
py::object value = py::none();
};
py::class_<OwnsPythonObjects> cls(
m, "OwnsPythonObjects", py::custom_type_setup([](PyHeapTypeObject *heap_type) {
auto *type = &heap_type->ht_type;
type->tp_flags |= Py_TPFLAGS_HAVE_GC;
type->tp_traverse = [](PyObject *self_base, visitproc visit, void *arg) {
auto &self = py::cast<OwnsPythonObjects&>(py::handle(self_base));
Py_VISIT(self.value.ptr());
return 0;
};
type->tp_clear = [](PyObject *self_base) {
auto &self = py::cast<OwnsPythonObjects&>(py::handle(self_base));
self.value = py::none();
return 0;
};
}));
cls.def(py::init<>());
cls.def_readwrite("value", &OwnsPythonObjects::value);
.. versionadded:: 2.8