Warning, /jana2/src/python/externals/pybind11-2.10.3/docs/changelog.rst is written in an unsupported language. File is not indexed.
0001 .. _changelog:
0002
0003 Changelog
0004 #########
0005
0006 Starting with version 1.8.0, pybind11 releases use a `semantic versioning
0007 <http://semver.org>`_ policy.
0008
0009 Changes will be added here periodically from the "Suggested changelog entry"
0010 block in pull request descriptions.
0011
0012
0013 IN DEVELOPMENT
0014 --------------
0015
0016 Changes will be summarized here periodically.
0017
0018 Changes:
0019
0020 * ``PyGILState_Check()``'s in ``pybind11::handle``'s ``inc_ref()`` &
0021 ``dec_ref()`` are now enabled by default again.
0022 `#4246 <https://github.com/pybind/pybind11/pull/4246>`_
0023
0024 Build system improvements:
0025
0026 * Update clang-tidy to 15 in CI.
0027 `#4387 <https://github.com/pybind/pybind11/pull/4387>`_
0028
0029
0030 Version 2.10.3 (Jan 3, 2023)
0031 ----------------------------
0032
0033 Changes:
0034
0035 * Temporarily made our GIL status assertions (added in 2.10.2) disabled by
0036 default (re-enable manually by defining
0037 ``PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF``, will be enabled in 2.11).
0038 `#4432 <https://github.com/pybind/pybind11/pull/4432>`_
0039
0040 * Improved error messages when ``inc_ref``/``dec_ref`` are called with an
0041 invalid GIL state.
0042 `#4427 <https://github.com/pybind/pybind11/pull/4427>`_
0043 `#4436 <https://github.com/pybind/pybind11/pull/4436>`_
0044
0045 Bug Fixes:
0046
0047 * Some minor touchups found by static analyzers.
0048 `#4440 <https://github.com/pybind/pybind11/pull/4440>`_
0049
0050
0051 Version 2.10.2 (Dec 20, 2022)
0052 -----------------------------
0053
0054 Changes:
0055
0056 * ``scoped_interpreter`` constructor taking ``PyConfig``.
0057 `#4330 <https://github.com/pybind/pybind11/pull/4330>`_
0058
0059 * ``pybind11/eigen/tensor.h`` adds converters to and from ``Eigen::Tensor`` and
0060 ``Eigen::TensorMap``.
0061 `#4201 <https://github.com/pybind/pybind11/pull/4201>`_
0062
0063 * ``PyGILState_Check()``'s were integrated to ``pybind11::handle``
0064 ``inc_ref()`` & ``dec_ref()``. The added GIL checks are guarded by
0065 ``PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF``, which is the default only if
0066 ``NDEBUG`` is not defined. (Made non-default in 2.10.3, will be active in 2.11)
0067 `#4246 <https://github.com/pybind/pybind11/pull/4246>`_
0068
0069 * Add option for enable/disable enum members in docstring.
0070 `#2768 <https://github.com/pybind/pybind11/pull/2768>`_
0071
0072 * Fixed typing of ``KeysView``, ``ValuesView`` and ``ItemsView`` in ``bind_map``.
0073 `#4353 <https://github.com/pybind/pybind11/pull/4353>`_
0074
0075 Bug fixes:
0076
0077 * Bug fix affecting only Python 3.6 under very specific, uncommon conditions:
0078 move ``PyEval_InitThreads()`` call to the correct location.
0079 `#4350 <https://github.com/pybind/pybind11/pull/4350>`_
0080
0081 * Fix segfault bug when passing foreign native functions to functional.h.
0082 `#4254 <https://github.com/pybind/pybind11/pull/4254>`_
0083
0084 Build system improvements:
0085
0086 * Support setting PYTHON_LIBRARIES manually for Windows ARM cross-compilation
0087 (classic mode).
0088 `#4406 <https://github.com/pybind/pybind11/pull/4406>`_
0089
0090 * Extend IPO/LTO detection for ICX (a.k.a IntelLLVM) compiler.
0091 `#4402 <https://github.com/pybind/pybind11/pull/4402>`_
0092
0093 * Allow calling ``find_package(pybind11 CONFIG)`` multiple times from separate
0094 directories in the same CMake project and properly link Python (new mode).
0095 `#4401 <https://github.com/pybind/pybind11/pull/4401>`_
0096
0097 * ``multiprocessing_set_spawn`` in pytest fixture for added safety.
0098 `#4377 <https://github.com/pybind/pybind11/pull/4377>`_
0099
0100 * Fixed a bug in two pybind11/tools cmake scripts causing "Unknown arguments specified" errors.
0101 `#4327 <https://github.com/pybind/pybind11/pull/4327>`_
0102
0103
0104
0105 Version 2.10.1 (Oct 31, 2022)
0106 -----------------------------
0107
0108 This is the first version to fully support embedding the newly released Python 3.11.
0109
0110 Changes:
0111
0112 * Allow ``pybind11::capsule`` constructor to take null destructor pointers.
0113 `#4221 <https://github.com/pybind/pybind11/pull/4221>`_
0114
0115 * ``embed.h`` was changed so that ``PYTHONPATH`` is used also with Python 3.11
0116 (established behavior).
0117 `#4119 <https://github.com/pybind/pybind11/pull/4119>`_
0118
0119 * A ``PYBIND11_SIMPLE_GIL_MANAGEMENT`` option was added (cmake, C++ define),
0120 along with many additional tests in ``test_gil_scoped.py``. The option may be
0121 useful to try when debugging GIL-related issues, to determine if the more
0122 complex default implementation is or is not to blame. See #4216 for
0123 background. WARNING: Please be careful to not create ODR violations when
0124 using the option: everything that is linked together with mutual symbol
0125 visibility needs to be rebuilt.
0126 `#4216 <https://github.com/pybind/pybind11/pull/4216>`_
0127
0128 * ``PYBIND11_EXPORT_EXCEPTION`` was made non-empty only under macOS. This makes
0129 Linux builds safer, and enables the removal of warning suppression pragmas for
0130 Windows.
0131 `#4298 <https://github.com/pybind/pybind11/pull/4298>`_
0132
0133 Bug fixes:
0134
0135 * Fixed a bug where ``UnicodeDecodeError`` was not propagated from various
0136 ``py::str`` ctors when decoding surrogate utf characters.
0137 `#4294 <https://github.com/pybind/pybind11/pull/4294>`_
0138
0139 * Revert perfect forwarding for ``make_iterator``. This broke at least one
0140 valid use case. May revisit later.
0141 `#4234 <https://github.com/pybind/pybind11/pull/4234>`_
0142
0143 * Fix support for safe casts to ``void*`` (regression in 2.10.0).
0144 `#4275 <https://github.com/pybind/pybind11/pull/4275>`_
0145
0146 * Fix ``char8_t`` support (regression in 2.9).
0147 `#4278 <https://github.com/pybind/pybind11/pull/4278>`_
0148
0149 * Unicode surrogate character in Python exception message leads to process
0150 termination in ``error_already_set::what()``.
0151 `#4297 <https://github.com/pybind/pybind11/pull/4297>`_
0152
0153 * Fix MSVC 2019 v.1924 & C++14 mode error for ``overload_cast``.
0154 `#4188 <https://github.com/pybind/pybind11/pull/4188>`_
0155
0156 * Make augmented assignment operators non-const for the object-api. Behavior
0157 was previously broken for augmented assignment operators.
0158 `#4065 <https://github.com/pybind/pybind11/pull/4065>`_
0159
0160 * Add proper error checking to C++ bindings for Python list append and insert.
0161 `#4208 <https://github.com/pybind/pybind11/pull/4208>`_
0162
0163 * Work-around for Nvidia's CUDA nvcc compiler in versions 11.4.0 - 11.8.0.
0164 `#4220 <https://github.com/pybind/pybind11/pull/4220>`_
0165
0166 * A workaround for PyPy was added in the ``py::error_already_set``
0167 implementation, related to PR `#1895 <https://github.com/pybind/pybind11/pull/1895>`_
0168 released with v2.10.0.
0169 `#4079 <https://github.com/pybind/pybind11/pull/4079>`_
0170
0171 * Fixed compiler errors when C++23 ``std::forward_like`` is available.
0172 `#4136 <https://github.com/pybind/pybind11/pull/4136>`_
0173
0174 * Properly raise exceptions in contains methods (like when an object in unhashable).
0175 `#4209 <https://github.com/pybind/pybind11/pull/4209>`_
0176
0177 * Further improve another error in exception handling.
0178 `#4232 <https://github.com/pybind/pybind11/pull/4232>`_
0179
0180 * ``get_local_internals()`` was made compatible with
0181 ``finalize_interpreter()``, fixing potential freezes during interpreter
0182 finalization.
0183 `#4192 <https://github.com/pybind/pybind11/pull/4192>`_
0184
0185 Performance and style:
0186
0187 * Reserve space in set and STL map casters if possible. This will prevent
0188 unnecessary rehashing / resizing by knowing the number of keys ahead of time
0189 for Python to C++ casting. This improvement will greatly speed up the casting
0190 of large unordered maps and sets.
0191 `#4194 <https://github.com/pybind/pybind11/pull/4194>`_
0192
0193 * GIL RAII scopes are non-copyable to avoid potential bugs.
0194 `#4183 <https://github.com/pybind/pybind11/pull/4183>`_
0195
0196 * Explicitly default all relevant ctors for pytypes in the ``PYBIND11_OBJECT``
0197 macros and enforce the clang-tidy checks ``modernize-use-equals-default`` in
0198 macros as well.
0199 `#4017 <https://github.com/pybind/pybind11/pull/4017>`_
0200
0201 * Optimize iterator advancement in C++ bindings.
0202 `#4237 <https://github.com/pybind/pybind11/pull/4237>`_
0203
0204 * Use the modern ``PyObject_GenericGetDict`` and ``PyObject_GenericSetDict``
0205 for handling dynamic attribute dictionaries.
0206 `#4106 <https://github.com/pybind/pybind11/pull/4106>`_
0207
0208 * Document that users should use ``PYBIND11_NAMESPACE`` instead of using ``pybind11`` when
0209 opening namespaces. Using namespace declarations and namespace qualification
0210 remain the same as ``pybind11``. This is done to ensure consistent symbol
0211 visibility.
0212 `#4098 <https://github.com/pybind/pybind11/pull/4098>`_
0213
0214 * Mark ``detail::forward_like`` as constexpr.
0215 `#4147 <https://github.com/pybind/pybind11/pull/4147>`_
0216
0217 * Optimize unpacking_collector when processing ``arg_v`` arguments.
0218 `#4219 <https://github.com/pybind/pybind11/pull/4219>`_
0219
0220 * Optimize casting C++ object to ``None``.
0221 `#4269 <https://github.com/pybind/pybind11/pull/4269>`_
0222
0223
0224 Build system improvements:
0225
0226 * CMake: revert overwrite behavior, now opt-in with ``PYBIND11_PYTHONLIBS_OVERRWRITE OFF``.
0227 `#4195 <https://github.com/pybind/pybind11/pull/4195>`_
0228
0229 * Include a pkg-config file when installing pybind11, such as in the Python
0230 package.
0231 `#4077 <https://github.com/pybind/pybind11/pull/4077>`_
0232
0233 * Avoid stripping debug symbols when ``CMAKE_BUILD_TYPE`` is set to ``DEBUG``
0234 instead of ``Debug``.
0235 `#4078 <https://github.com/pybind/pybind11/pull/4078>`_
0236
0237 * Followup to `#3948 <https://github.com/pybind/pybind11/pull/3948>`_, fixing vcpkg again.
0238 `#4123 <https://github.com/pybind/pybind11/pull/4123>`_
0239
0240 Version 2.10.0 (Jul 15, 2022)
0241 -----------------------------
0242
0243 Removed support for Python 2.7, Python 3.5, and MSVC 2015. Support for MSVC
0244 2017 is limited due to availability of CI runners; we highly recommend MSVC
0245 2019 or 2022 be used. Initial support added for Python 3.11.
0246
0247 New features:
0248
0249 * ``py::anyset`` & ``py::frozenset`` were added, with copying (cast) to
0250 ``std::set`` (similar to ``set``).
0251 `#3901 <https://github.com/pybind/pybind11/pull/3901>`_
0252
0253 * Support bytearray casting to string.
0254 `#3707 <https://github.com/pybind/pybind11/pull/3707>`_
0255
0256 * ``type_caster<std::monostate>`` was added. ``std::monostate`` is a tag type
0257 that allows ``std::variant`` to act as an optional, or allows default
0258 construction of a ``std::variant`` holding a non-default constructible type.
0259 `#3818 <https://github.com/pybind/pybind11/pull/3818>`_
0260
0261 * ``pybind11::capsule::set_name`` added to mutate the name of the capsule instance.
0262 `#3866 <https://github.com/pybind/pybind11/pull/3866>`_
0263
0264 * NumPy: dtype constructor from type number added, accessors corresponding to
0265 Python API ``dtype.num``, ``dtype.byteorder``, ``dtype.flags`` and
0266 ``dtype.alignment`` added.
0267 `#3868 <https://github.com/pybind/pybind11/pull/3868>`_
0268
0269
0270 Changes:
0271
0272 * Python 3.6 is now the minimum supported version.
0273 `#3688 <https://github.com/pybind/pybind11/pull/3688>`_
0274 `#3719 <https://github.com/pybind/pybind11/pull/3719>`_
0275
0276 * The minimum version for MSVC is now 2017.
0277 `#3722 <https://github.com/pybind/pybind11/pull/3722>`_
0278
0279 * Fix issues with CPython 3.11 betas and add to supported test matrix.
0280 `#3923 <https://github.com/pybind/pybind11/pull/3923>`_
0281
0282 * ``error_already_set`` is now safer and more performant, especially for
0283 exceptions with long tracebacks, by delaying computation.
0284 `#1895 <https://github.com/pybind/pybind11/pull/1895>`_
0285
0286 * Improve exception handling in python ``str`` bindings.
0287 `#3826 <https://github.com/pybind/pybind11/pull/3826>`_
0288
0289 * The bindings for capsules now have more consistent exception handling.
0290 `#3825 <https://github.com/pybind/pybind11/pull/3825>`_
0291
0292 * ``PYBIND11_OBJECT_CVT`` and ``PYBIND11_OBJECT_CVT_DEFAULT`` macro can now be
0293 used to define classes in namespaces other than pybind11.
0294 `#3797 <https://github.com/pybind/pybind11/pull/3797>`_
0295
0296 * Error printing code now uses ``PYBIND11_DETAILED_ERROR_MESSAGES`` instead of
0297 requiring ``NDEBUG``, allowing use with release builds if desired.
0298 `#3913 <https://github.com/pybind/pybind11/pull/3913>`_
0299
0300 * Implicit conversion of the literal ``0`` to ``pybind11::handle`` is now disabled.
0301 `#4008 <https://github.com/pybind/pybind11/pull/4008>`_
0302
0303
0304 Bug fixes:
0305
0306 * Fix exception handling when ``pybind11::weakref()`` fails.
0307 `#3739 <https://github.com/pybind/pybind11/pull/3739>`_
0308
0309 * ``module_::def_submodule`` was missing proper error handling. This is fixed now.
0310 `#3973 <https://github.com/pybind/pybind11/pull/3973>`_
0311
0312 * The behavior or ``error_already_set`` was made safer and the highly opaque
0313 "Unknown internal error occurred" message was replaced with a more helpful
0314 message.
0315 `#3982 <https://github.com/pybind/pybind11/pull/3982>`_
0316
0317 * ``error_already_set::what()`` now handles non-normalized exceptions correctly.
0318 `#3971 <https://github.com/pybind/pybind11/pull/3971>`_
0319
0320 * Support older C++ compilers where filesystem is not yet part of the standard
0321 library and is instead included in ``std::experimental::filesystem``.
0322 `#3840 <https://github.com/pybind/pybind11/pull/3840>`_
0323
0324 * Fix ``-Wfree-nonheap-object`` warnings produced by GCC by avoiding returning
0325 pointers to static objects with ``return_value_policy::take_ownership``.
0326 `#3946 <https://github.com/pybind/pybind11/pull/3946>`_
0327
0328 * Fix cast from pytype rvalue to another pytype.
0329 `#3949 <https://github.com/pybind/pybind11/pull/3949>`_
0330
0331 * Ensure proper behavior when garbage collecting classes with dynamic attributes in Python >=3.9.
0332 `#4051 <https://github.com/pybind/pybind11/pull/4051>`_
0333
0334 * A couple long-standing ``PYBIND11_NAMESPACE``
0335 ``__attribute__((visibility("hidden")))`` inconsistencies are now fixed
0336 (affects only unusual environments).
0337 `#4043 <https://github.com/pybind/pybind11/pull/4043>`_
0338
0339 * ``pybind11::detail::get_internals()`` is now resilient to in-flight Python
0340 exceptions.
0341 `#3981 <https://github.com/pybind/pybind11/pull/3981>`_
0342
0343 * Arrays with a dimension of size 0 are now properly converted to dynamic Eigen
0344 matrices (more common in NumPy 1.23).
0345 `#4038 <https://github.com/pybind/pybind11/pull/4038>`_
0346
0347 * Avoid catching unrelated errors when importing NumPy.
0348 `#3974 <https://github.com/pybind/pybind11/pull/3974>`_
0349
0350 Performance and style:
0351
0352 * Added an accessor overload of ``(object &&key)`` to reference steal the
0353 object when using python types as keys. This prevents unnecessary reference
0354 count overhead for attr, dictionary, tuple, and sequence look ups. Added
0355 additional regression tests. Fixed a performance bug the caused accessor
0356 assignments to potentially perform unnecessary copies.
0357 `#3970 <https://github.com/pybind/pybind11/pull/3970>`_
0358
0359 * Perfect forward all args of ``make_iterator``.
0360 `#3980 <https://github.com/pybind/pybind11/pull/3980>`_
0361
0362 * Avoid potential bug in pycapsule destructor by adding an ``error_guard`` to
0363 one of the dtors.
0364 `#3958 <https://github.com/pybind/pybind11/pull/3958>`_
0365
0366 * Optimize dictionary access in ``strip_padding`` for numpy.
0367 `#3994 <https://github.com/pybind/pybind11/pull/3994>`_
0368
0369 * ``stl_bind.h`` bindings now take slice args as a const-ref.
0370 `#3852 <https://github.com/pybind/pybind11/pull/3852>`_
0371
0372 * Made slice constructor more consistent, and improve performance of some
0373 casters by allowing reference stealing.
0374 `#3845 <https://github.com/pybind/pybind11/pull/3845>`_
0375
0376 * Change numpy dtype from_args method to use const ref.
0377 `#3878 <https://github.com/pybind/pybind11/pull/3878>`_
0378
0379 * Follow rule of three to ensure ``PyErr_Restore`` is called only once.
0380 `#3872 <https://github.com/pybind/pybind11/pull/3872>`_
0381
0382 * Added missing perfect forwarding for ``make_iterator`` functions.
0383 `#3860 <https://github.com/pybind/pybind11/pull/3860>`_
0384
0385 * Optimize c++ to python function casting by using the rvalue caster.
0386 `#3966 <https://github.com/pybind/pybind11/pull/3966>`_
0387
0388 * Optimize Eigen sparse matrix casting by removing unnecessary temporary.
0389 `#4064 <https://github.com/pybind/pybind11/pull/4064>`_
0390
0391 * Avoid potential implicit copy/assignment constructors causing double free in
0392 ``strdup_gaurd``.
0393 `#3905 <https://github.com/pybind/pybind11/pull/3905>`_
0394
0395 * Enable clang-tidy checks ``misc-definitions-in-headers``,
0396 ``modernize-loop-convert``, and ``modernize-use-nullptr``.
0397 `#3881 <https://github.com/pybind/pybind11/pull/3881>`_
0398 `#3988 <https://github.com/pybind/pybind11/pull/3988>`_
0399
0400
0401 Build system improvements:
0402
0403 * CMake: Fix file extension on Windows with cp36 and cp37 using FindPython.
0404 `#3919 <https://github.com/pybind/pybind11/pull/3919>`_
0405
0406 * CMake: Support multiple Python targets (such as on vcpkg).
0407 `#3948 <https://github.com/pybind/pybind11/pull/3948>`_
0408
0409 * CMake: Fix issue with NVCC on Windows.
0410 `#3947 <https://github.com/pybind/pybind11/pull/3947>`_
0411
0412 * CMake: Drop the bitness check on cross compiles (like targeting WebAssembly
0413 via Emscripten).
0414 `#3959 <https://github.com/pybind/pybind11/pull/3959>`_
0415
0416 * Add MSVC builds in debug mode to CI.
0417 `#3784 <https://github.com/pybind/pybind11/pull/3784>`_
0418
0419 * MSVC 2022 C++20 coverage was added to GitHub Actions, including Eigen.
0420 `#3732 <https://github.com/pybind/pybind11/pull/3732>`_,
0421 `#3741 <https://github.com/pybind/pybind11/pull/3741>`_
0422
0423
0424 Backend and tidying up:
0425
0426 * New theme for the documentation.
0427 `#3109 <https://github.com/pybind/pybind11/pull/3109>`_
0428
0429 * Remove idioms in code comments. Use more inclusive language.
0430 `#3809 <https://github.com/pybind/pybind11/pull/3809>`_
0431
0432 * ``#include <iostream>`` was removed from the ``pybind11/stl.h`` header. Your
0433 project may break if it has a transitive dependency on this include. The fix
0434 is to "Include What You Use".
0435 `#3928 <https://github.com/pybind/pybind11/pull/3928>`_
0436
0437 * Avoid ``setup.py <command>`` usage in internal tests.
0438 `#3734 <https://github.com/pybind/pybind11/pull/3734>`_
0439
0440
0441 Version 2.9.2 (Mar 29, 2022)
0442 ----------------------------
0443
0444 Changes:
0445
0446 * Enum now has an ``__index__`` method on Python <3.8 too.
0447 `#3700 <https://github.com/pybind/pybind11/pull/3700>`_
0448
0449 * Local internals are now cleared after finalizing the interpreter.
0450 `#3744 <https://github.com/pybind/pybind11/pull/3744>`_
0451
0452 Bug fixes:
0453
0454 * Better support for Python 3.11 alphas.
0455 `#3694 <https://github.com/pybind/pybind11/pull/3694>`_
0456
0457 * ``PYBIND11_TYPE_CASTER`` now uses fully qualified symbols, so it can be used
0458 outside of ``pybind11::detail``.
0459 `#3758 <https://github.com/pybind/pybind11/pull/3758>`_
0460
0461 * Some fixes for PyPy 3.9.
0462 `#3768 <https://github.com/pybind/pybind11/pull/3768>`_
0463
0464 * Fixed a potential memleak in PyPy in ``get_type_override``.
0465 `#3774 <https://github.com/pybind/pybind11/pull/3774>`_
0466
0467 * Fix usage of ``VISIBILITY_INLINES_HIDDEN``.
0468 `#3721 <https://github.com/pybind/pybind11/pull/3721>`_
0469
0470
0471 Build system improvements:
0472
0473 * Uses ``sysconfig`` module to determine installation locations on Python >=
0474 3.10, instead of ``distutils`` which has been deprecated.
0475 `#3764 <https://github.com/pybind/pybind11/pull/3764>`_
0476
0477 * Support Catch 2.13.5+ (supporting GLIBC 2.34+).
0478 `#3679 <https://github.com/pybind/pybind11/pull/3679>`_
0479
0480 * Fix test failures with numpy 1.22 by ignoring whitespace when comparing
0481 ``str()`` of dtypes.
0482 `#3682 <https://github.com/pybind/pybind11/pull/3682>`_
0483
0484
0485 Backend and tidying up:
0486
0487 * clang-tidy: added ``readability-qualified-auto``,
0488 ``readability-braces-around-statements``,
0489 ``cppcoreguidelines-prefer-member-initializer``,
0490 ``clang-analyzer-optin.performance.Padding``,
0491 ``cppcoreguidelines-pro-type-static-cast-downcast``, and
0492 ``readability-inconsistent-declaration-parameter-name``.
0493 `#3702 <https://github.com/pybind/pybind11/pull/3702>`_,
0494 `#3699 <https://github.com/pybind/pybind11/pull/3699>`_,
0495 `#3716 <https://github.com/pybind/pybind11/pull/3716>`_,
0496 `#3709 <https://github.com/pybind/pybind11/pull/3709>`_
0497
0498 * clang-format was added to the pre-commit actions, and the entire code base
0499 automatically reformatted (after several iterations preparing for this leap).
0500 `#3713 <https://github.com/pybind/pybind11/pull/3713>`_
0501
0502
0503 Version 2.9.1 (Feb 2, 2022)
0504 ---------------------------
0505
0506 Changes:
0507
0508 * If possible, attach Python exception with ``py::raise_from`` to ``TypeError``
0509 when casting from C++ to Python. This will give additional info if Python
0510 exceptions occur in the caster. Adds a test case of trying to convert a set
0511 from C++ to Python when the hash function is not defined in Python.
0512 `#3605 <https://github.com/pybind/pybind11/pull/3605>`_
0513
0514 * Add a mapping of C++11 nested exceptions to their Python exception
0515 equivalent using ``py::raise_from``. This attaches the nested exceptions in
0516 Python using the ``__cause__`` field.
0517 `#3608 <https://github.com/pybind/pybind11/pull/3608>`_
0518
0519 * Propagate Python exception traceback using ``raise_from`` if a pybind11
0520 function runs out of overloads.
0521 `#3671 <https://github.com/pybind/pybind11/pull/3671>`_
0522
0523 * ``py::multiple_inheritance`` is now only needed when C++ bases are hidden
0524 from pybind11.
0525 `#3650 <https://github.com/pybind/pybind11/pull/3650>`_ and
0526 `#3659 <https://github.com/pybind/pybind11/pull/3659>`_
0527
0528
0529 Bug fixes:
0530
0531 * Remove a boolean cast in ``numpy.h`` that causes MSVC C4800 warnings when
0532 compiling against Python 3.10 or newer.
0533 `#3669 <https://github.com/pybind/pybind11/pull/3669>`_
0534
0535 * Render ``py::bool_`` and ``py::float_`` as ``bool`` and ``float``
0536 respectively.
0537 `#3622 <https://github.com/pybind/pybind11/pull/3622>`_
0538
0539 Build system improvements:
0540
0541 * Fix CMake extension suffix computation on Python 3.10+.
0542 `#3663 <https://github.com/pybind/pybind11/pull/3663>`_
0543
0544 * Allow ``CMAKE_ARGS`` to override CMake args in pybind11's own ``setup.py``.
0545 `#3577 <https://github.com/pybind/pybind11/pull/3577>`_
0546
0547 * Remove a few deprecated c-headers.
0548 `#3610 <https://github.com/pybind/pybind11/pull/3610>`_
0549
0550 * More uniform handling of test targets.
0551 `#3590 <https://github.com/pybind/pybind11/pull/3590>`_
0552
0553 * Add clang-tidy readability check to catch potentially swapped function args.
0554 `#3611 <https://github.com/pybind/pybind11/pull/3611>`_
0555
0556
0557 Version 2.9.0 (Dec 28, 2021)
0558 ----------------------------
0559
0560 This is the last version to support Python 2.7 and 3.5.
0561
0562 New Features:
0563
0564 * Allow ``py::args`` to be followed by other arguments; the remaining arguments
0565 are implicitly keyword-only, as if a ``py::kw_only{}`` annotation had been
0566 used.
0567 `#3402 <https://github.com/pybind/pybind11/pull/3402>`_
0568
0569 Changes:
0570
0571 * Make str/bytes/memoryview more interoperable with ``std::string_view``.
0572 `#3521 <https://github.com/pybind/pybind11/pull/3521>`_
0573
0574 * Replace ``_`` with ``const_name`` in internals, avoid defining ``pybind::_``
0575 if ``_`` defined as macro (common gettext usage)
0576 `#3423 <https://github.com/pybind/pybind11/pull/3423>`_
0577
0578
0579 Bug fixes:
0580
0581 * Fix a rare warning about extra copy in an Eigen constructor.
0582 `#3486 <https://github.com/pybind/pybind11/pull/3486>`_
0583
0584 * Fix caching of the C++ overrides.
0585 `#3465 <https://github.com/pybind/pybind11/pull/3465>`_
0586
0587 * Add missing ``std::forward`` calls to some ``cpp_function`` overloads.
0588 `#3443 <https://github.com/pybind/pybind11/pull/3443>`_
0589
0590 * Support PyPy 7.3.7 and the PyPy3.8 beta. Test python-3.11 on PRs with the
0591 ``python dev`` label.
0592 `#3419 <https://github.com/pybind/pybind11/pull/3419>`_
0593
0594 * Replace usage of deprecated ``Eigen::MappedSparseMatrix`` with
0595 ``Eigen::Map<Eigen::SparseMatrix<...>>`` for Eigen 3.3+.
0596 `#3499 <https://github.com/pybind/pybind11/pull/3499>`_
0597
0598 * Tweaks to support Microsoft Visual Studio 2022.
0599 `#3497 <https://github.com/pybind/pybind11/pull/3497>`_
0600
0601 Build system improvements:
0602
0603 * Nicer CMake printout and IDE organisation for pybind11's own tests.
0604 `#3479 <https://github.com/pybind/pybind11/pull/3479>`_
0605
0606 * CMake: report version type as part of the version string to avoid a spurious
0607 space in the package status message.
0608 `#3472 <https://github.com/pybind/pybind11/pull/3472>`_
0609
0610 * Flags starting with ``-g`` in ``$CFLAGS`` and ``$CPPFLAGS`` are no longer
0611 overridden by ``.Pybind11Extension``.
0612 `#3436 <https://github.com/pybind/pybind11/pull/3436>`_
0613
0614 * Ensure ThreadPool is closed in ``setup_helpers``.
0615 `#3548 <https://github.com/pybind/pybind11/pull/3548>`_
0616
0617 * Avoid LTS on ``mips64`` and ``ppc64le`` (reported broken).
0618 `#3557 <https://github.com/pybind/pybind11/pull/3557>`_
0619
0620
0621 v2.8.1 (Oct 27, 2021)
0622 ---------------------
0623
0624 Changes and additions:
0625
0626 * The simple namespace creation shortcut added in 2.8.0 was deprecated due to
0627 usage of CPython internal API, and will be removed soon. Use
0628 ``py::module_::import("types").attr("SimpleNamespace")``.
0629 `#3374 <https://github.com/pybinyyd/pybind11/pull/3374>`_
0630
0631 * Add C++ Exception type to throw and catch ``AttributeError``. Useful for
0632 defining custom ``__setattr__`` and ``__getattr__`` methods.
0633 `#3387 <https://github.com/pybind/pybind11/pull/3387>`_
0634
0635 Fixes:
0636
0637 * Fixed the potential for dangling references when using properties with
0638 ``std::optional`` types.
0639 `#3376 <https://github.com/pybind/pybind11/pull/3376>`_
0640
0641 * Modernize usage of ``PyCodeObject`` on Python 3.9+ (moving toward support for
0642 Python 3.11a1)
0643 `#3368 <https://github.com/pybind/pybind11/pull/3368>`_
0644
0645 * A long-standing bug in ``eigen.h`` was fixed (originally PR #3343). The bug
0646 was unmasked by newly added ``static_assert``'s in the Eigen 3.4.0 release.
0647 `#3352 <https://github.com/pybind/pybind11/pull/3352>`_
0648
0649 * Support multiple raw inclusion of CMake helper files (Conan.io does this for
0650 multi-config generators).
0651 `#3420 <https://github.com/pybind/pybind11/pull/3420>`_
0652
0653 * Fix harmless warning on upcoming CMake 3.22.
0654 `#3368 <https://github.com/pybind/pybind11/pull/3368>`_
0655
0656 * Fix 2.8.0 regression with MSVC 2017 + C++17 mode + Python 3.
0657 `#3407 <https://github.com/pybind/pybind11/pull/3407>`_
0658
0659 * Fix 2.8.0 regression that caused undefined behavior (typically
0660 segfaults) in ``make_key_iterator``/``make_value_iterator`` if dereferencing
0661 the iterator returned a temporary value instead of a reference.
0662 `#3348 <https://github.com/pybind/pybind11/pull/3348>`_
0663
0664
0665 v2.8.0 (Oct 4, 2021)
0666 --------------------
0667
0668 New features:
0669
0670 * Added ``py::raise_from`` to enable chaining exceptions.
0671 `#3215 <https://github.com/pybind/pybind11/pull/3215>`_
0672
0673 * Allow exception translators to be optionally registered local to a module
0674 instead of applying globally across all pybind11 modules. Use
0675 ``register_local_exception_translator(ExceptionTranslator&& translator)``
0676 instead of ``register_exception_translator(ExceptionTranslator&&
0677 translator)`` to keep your exception remapping code local to the module.
0678 `#2650 <https://github.com/pybinyyd/pybind11/pull/2650>`_
0679
0680 * Add ``make_simple_namespace`` function for instantiating Python
0681 ``SimpleNamespace`` objects. **Deprecated in 2.8.1.**
0682 `#2840 <https://github.com/pybind/pybind11/pull/2840>`_
0683
0684 * ``pybind11::scoped_interpreter`` and ``initialize_interpreter`` have new
0685 arguments to allow ``sys.argv`` initialization.
0686 `#2341 <https://github.com/pybind/pybind11/pull/2341>`_
0687
0688 * Allow Python builtins to be used as callbacks in CPython.
0689 `#1413 <https://github.com/pybind/pybind11/pull/1413>`_
0690
0691 * Added ``view`` to view arrays with a different datatype.
0692 `#987 <https://github.com/pybind/pybind11/pull/987>`_
0693
0694 * Implemented ``reshape`` on arrays.
0695 `#984 <https://github.com/pybind/pybind11/pull/984>`_
0696
0697 * Enable defining custom ``__new__`` methods on classes by fixing bug
0698 preventing overriding methods if they have non-pybind11 siblings.
0699 `#3265 <https://github.com/pybind/pybind11/pull/3265>`_
0700
0701 * Add ``make_value_iterator()``, and fix ``make_key_iterator()`` to return
0702 references instead of copies.
0703 `#3293 <https://github.com/pybind/pybind11/pull/3293>`_
0704
0705 * Improve the classes generated by ``bind_map``: `#3310 <https://github.com/pybind/pybind11/pull/3310>`_
0706
0707 * Change ``.items`` from an iterator to a dictionary view.
0708 * Add ``.keys`` and ``.values`` (both dictionary views).
0709 * Allow ``__contains__`` to take any object.
0710
0711 * ``pybind11::custom_type_setup`` was added, for customizing the
0712 ``PyHeapTypeObject`` corresponding to a class, which may be useful for
0713 enabling garbage collection support, among other things.
0714 `#3287 <https://github.com/pybind/pybind11/pull/3287>`_
0715
0716
0717 Changes:
0718
0719 * Set ``__file__`` constant when running ``eval_file`` in an embedded interpreter.
0720 `#3233 <https://github.com/pybind/pybind11/pull/3233>`_
0721
0722 * Python objects and (C++17) ``std::optional`` now accepted in ``py::slice``
0723 constructor.
0724 `#1101 <https://github.com/pybind/pybind11/pull/1101>`_
0725
0726 * The pybind11 proxy types ``str``, ``bytes``, ``bytearray``, ``tuple``,
0727 ``list`` now consistently support passing ``ssize_t`` values for sizes and
0728 indexes. Previously, only ``size_t`` was accepted in several interfaces.
0729 `#3219 <https://github.com/pybind/pybind11/pull/3219>`_
0730
0731 * Avoid evaluating ``PYBIND11_TLS_REPLACE_VALUE`` arguments more than once.
0732 `#3290 <https://github.com/pybind/pybind11/pull/3290>`_
0733
0734 Fixes:
0735
0736 * Bug fix: enum value's ``__int__`` returning non-int when underlying type is
0737 bool or of char type.
0738 `#1334 <https://github.com/pybind/pybind11/pull/1334>`_
0739
0740 * Fixes bug in setting error state in Capsule's pointer methods.
0741 `#3261 <https://github.com/pybind/pybind11/pull/3261>`_
0742
0743 * A long-standing memory leak in ``py::cpp_function::initialize`` was fixed.
0744 `#3229 <https://github.com/pybind/pybind11/pull/3229>`_
0745
0746 * Fixes thread safety for some ``pybind11::type_caster`` which require lifetime
0747 extension, such as for ``std::string_view``.
0748 `#3237 <https://github.com/pybind/pybind11/pull/3237>`_
0749
0750 * Restore compatibility with gcc 4.8.4 as distributed by ubuntu-trusty, linuxmint-17.
0751 `#3270 <https://github.com/pybind/pybind11/pull/3270>`_
0752
0753
0754 Build system improvements:
0755
0756 * Fix regression in CMake Python package config: improper use of absolute path.
0757 `#3144 <https://github.com/pybind/pybind11/pull/3144>`_
0758
0759 * Cached Python version information could become stale when CMake was re-run
0760 with a different Python version. The build system now detects this and
0761 updates this information.
0762 `#3299 <https://github.com/pybind/pybind11/pull/3299>`_
0763
0764 * Specified UTF8-encoding in setup.py calls of open().
0765 `#3137 <https://github.com/pybind/pybind11/pull/3137>`_
0766
0767 * Fix a harmless warning from CMake 3.21 with the classic Python discovery.
0768 `#3220 <https://github.com/pybind/pybind11/pull/3220>`_
0769
0770 * Eigen repo and version can now be specified as cmake options.
0771 `#3324 <https://github.com/pybind/pybind11/pull/3324>`_
0772
0773
0774 Backend and tidying up:
0775
0776 * Reduced thread-local storage required for keeping alive temporary data for
0777 type conversion to one key per ABI version, rather than one key per extension
0778 module. This makes the total thread-local storage required by pybind11 2
0779 keys per ABI version.
0780 `#3275 <https://github.com/pybind/pybind11/pull/3275>`_
0781
0782 * Optimize NumPy array construction with additional moves.
0783 `#3183 <https://github.com/pybind/pybind11/pull/3183>`_
0784
0785 * Conversion to ``std::string`` and ``std::string_view`` now avoids making an
0786 extra copy of the data on Python >= 3.3.
0787 `#3257 <https://github.com/pybind/pybind11/pull/3257>`_
0788
0789 * Remove const modifier from certain C++ methods on Python collections
0790 (``list``, ``set``, ``dict``) such as (``clear()``, ``append()``,
0791 ``insert()``, etc...) and annotated them with ``py-non-const``.
0792
0793 * Enable readability ``clang-tidy-const-return`` and remove useless consts.
0794 `#3254 <https://github.com/pybind/pybind11/pull/3254>`_
0795 `#3194 <https://github.com/pybind/pybind11/pull/3194>`_
0796
0797 * The clang-tidy ``google-explicit-constructor`` option was enabled.
0798 `#3250 <https://github.com/pybind/pybind11/pull/3250>`_
0799
0800 * Mark a pytype move constructor as noexcept (perf).
0801 `#3236 <https://github.com/pybind/pybind11/pull/3236>`_
0802
0803 * Enable clang-tidy check to guard against inheritance slicing.
0804 `#3210 <https://github.com/pybind/pybind11/pull/3210>`_
0805
0806 * Legacy warning suppression pragma were removed from eigen.h. On Unix
0807 platforms, please use -isystem for Eigen include directories, to suppress
0808 compiler warnings originating from Eigen headers. Note that CMake does this
0809 by default. No adjustments are needed for Windows.
0810 `#3198 <https://github.com/pybind/pybind11/pull/3198>`_
0811
0812 * Format pybind11 with isort consistent ordering of imports
0813 `#3195 <https://github.com/pybind/pybind11/pull/3195>`_
0814
0815 * The warnings-suppression "pragma clamp" at the top/bottom of pybind11 was
0816 removed, clearing the path to refactoring and IWYU cleanup.
0817 `#3186 <https://github.com/pybind/pybind11/pull/3186>`_
0818
0819 * Enable most bugprone checks in clang-tidy and fix the found potential bugs
0820 and poor coding styles.
0821 `#3166 <https://github.com/pybind/pybind11/pull/3166>`_
0822
0823 * Add ``clang-tidy-readability`` rules to make boolean casts explicit improving
0824 code readability. Also enabled other misc and readability clang-tidy checks.
0825 `#3148 <https://github.com/pybind/pybind11/pull/3148>`_
0826
0827 * Move object in ``.pop()`` for list.
0828 `#3116 <https://github.com/pybind/pybind11/pull/3116>`_
0829
0830
0831
0832
0833 v2.7.1 (Aug 3, 2021)
0834 ---------------------
0835
0836 Minor missing functionality added:
0837
0838 * Allow Python builtins to be used as callbacks in CPython.
0839 `#1413 <https://github.com/pybind/pybind11/pull/1413>`_
0840
0841 Bug fixes:
0842
0843 * Fix regression in CMake Python package config: improper use of absolute path.
0844 `#3144 <https://github.com/pybind/pybind11/pull/3144>`_
0845
0846 * Fix Mingw64 and add to the CI testing matrix.
0847 `#3132 <https://github.com/pybind/pybind11/pull/3132>`_
0848
0849 * Specified UTF8-encoding in setup.py calls of open().
0850 `#3137 <https://github.com/pybind/pybind11/pull/3137>`_
0851
0852 * Add clang-tidy-readability rules to make boolean casts explicit improving
0853 code readability. Also enabled other misc and readability clang-tidy checks.
0854 `#3148 <https://github.com/pybind/pybind11/pull/3148>`_
0855
0856 * Move object in ``.pop()`` for list.
0857 `#3116 <https://github.com/pybind/pybind11/pull/3116>`_
0858
0859 Backend and tidying up:
0860
0861 * Removed and fixed warning suppressions.
0862 `#3127 <https://github.com/pybind/pybind11/pull/3127>`_
0863 `#3129 <https://github.com/pybind/pybind11/pull/3129>`_
0864 `#3135 <https://github.com/pybind/pybind11/pull/3135>`_
0865 `#3141 <https://github.com/pybind/pybind11/pull/3141>`_
0866 `#3142 <https://github.com/pybind/pybind11/pull/3142>`_
0867 `#3150 <https://github.com/pybind/pybind11/pull/3150>`_
0868 `#3152 <https://github.com/pybind/pybind11/pull/3152>`_
0869 `#3160 <https://github.com/pybind/pybind11/pull/3160>`_
0870 `#3161 <https://github.com/pybind/pybind11/pull/3161>`_
0871
0872
0873 v2.7.0 (Jul 16, 2021)
0874 ---------------------
0875
0876 New features:
0877
0878 * Enable ``py::implicitly_convertible<py::none, ...>`` for
0879 ``py::class_``-wrapped types.
0880 `#3059 <https://github.com/pybind/pybind11/pull/3059>`_
0881
0882 * Allow function pointer extraction from overloaded functions.
0883 `#2944 <https://github.com/pybind/pybind11/pull/2944>`_
0884
0885 * NumPy: added ``.char_()`` to type which gives the NumPy public ``char``
0886 result, which also distinguishes types by bit length (unlike ``.kind()``).
0887 `#2864 <https://github.com/pybind/pybind11/pull/2864>`_
0888
0889 * Add ``pybind11::bytearray`` to manipulate ``bytearray`` similar to ``bytes``.
0890 `#2799 <https://github.com/pybind/pybind11/pull/2799>`_
0891
0892 * ``pybind11/stl/filesystem.h`` registers a type caster that, on C++17/Python
0893 3.6+, converts ``std::filesystem::path`` to ``pathlib.Path`` and any
0894 ``os.PathLike`` to ``std::filesystem::path``.
0895 `#2730 <https://github.com/pybind/pybind11/pull/2730>`_
0896
0897 * A ``PYBIND11_VERSION_HEX`` define was added, similar to ``PY_VERSION_HEX``.
0898 `#3120 <https://github.com/pybind/pybind11/pull/3120>`_
0899
0900
0901
0902 Changes:
0903
0904 * ``py::str`` changed to exclusively hold ``PyUnicodeObject``. Previously
0905 ``py::str`` could also hold ``bytes``, which is probably surprising, was
0906 never documented, and can mask bugs (e.g. accidental use of ``py::str``
0907 instead of ``py::bytes``).
0908 `#2409 <https://github.com/pybind/pybind11/pull/2409>`_
0909
0910 * Add a safety guard to ensure that the Python GIL is held when C++ calls back
0911 into Python via ``object_api<>::operator()`` (e.g. ``py::function``
0912 ``__call__``). (This feature is available for Python 3.6+ only.)
0913 `#2919 <https://github.com/pybind/pybind11/pull/2919>`_
0914
0915 * Catch a missing ``self`` argument in calls to ``__init__()``.
0916 `#2914 <https://github.com/pybind/pybind11/pull/2914>`_
0917
0918 * Use ``std::string_view`` if available to avoid a copy when passing an object
0919 to a ``std::ostream``.
0920 `#3042 <https://github.com/pybind/pybind11/pull/3042>`_
0921
0922 * An important warning about thread safety was added to the ``iostream.h``
0923 documentation; attempts to make ``py::scoped_ostream_redirect`` thread safe
0924 have been removed, as it was only partially effective.
0925 `#2995 <https://github.com/pybind/pybind11/pull/2995>`_
0926
0927
0928 Fixes:
0929
0930 * Performance: avoid unnecessary strlen calls.
0931 `#3058 <https://github.com/pybind/pybind11/pull/3058>`_
0932
0933 * Fix auto-generated documentation string when using ``const T`` in
0934 ``pyarray_t``.
0935 `#3020 <https://github.com/pybind/pybind11/pull/3020>`_
0936
0937 * Unify error messages thrown by ``simple_collector``/``unpacking_collector``.
0938 `#3013 <https://github.com/pybind/pybind11/pull/3013>`_
0939
0940 * ``pybind11::builtin_exception`` is now explicitly exported, which means the
0941 types included/defined in different modules are identical, and exceptions
0942 raised in different modules can be caught correctly. The documentation was
0943 updated to explain that custom exceptions that are used across module
0944 boundaries need to be explicitly exported as well.
0945 `#2999 <https://github.com/pybind/pybind11/pull/2999>`_
0946
0947 * Fixed exception when printing UTF-8 to a ``scoped_ostream_redirect``.
0948 `#2982 <https://github.com/pybind/pybind11/pull/2982>`_
0949
0950 * Pickle support enhancement: ``setstate`` implementation will attempt to
0951 ``setattr`` ``__dict__`` only if the unpickled ``dict`` object is not empty,
0952 to not force use of ``py::dynamic_attr()`` unnecessarily.
0953 `#2972 <https://github.com/pybind/pybind11/pull/2972>`_
0954
0955 * Allow negative timedelta values to roundtrip.
0956 `#2870 <https://github.com/pybind/pybind11/pull/2870>`_
0957
0958 * Fix unchecked errors could potentially swallow signals/other exceptions.
0959 `#2863 <https://github.com/pybind/pybind11/pull/2863>`_
0960
0961 * Add null pointer check with ``std::localtime``.
0962 `#2846 <https://github.com/pybind/pybind11/pull/2846>`_
0963
0964 * Fix the ``weakref`` constructor from ``py::object`` to create a new
0965 ``weakref`` on conversion.
0966 `#2832 <https://github.com/pybind/pybind11/pull/2832>`_
0967
0968 * Avoid relying on exceptions in C++17 when getting a ``shared_ptr`` holder
0969 from a ``shared_from_this`` class.
0970 `#2819 <https://github.com/pybind/pybind11/pull/2819>`_
0971
0972 * Allow the codec's exception to be raised instead of :code:`RuntimeError` when
0973 casting from :code:`py::str` to :code:`std::string`.
0974 `#2903 <https://github.com/pybind/pybind11/pull/2903>`_
0975
0976
0977 Build system improvements:
0978
0979 * In ``setup_helpers.py``, test for platforms that have some multiprocessing
0980 features but lack semaphores, which ``ParallelCompile`` requires.
0981 `#3043 <https://github.com/pybind/pybind11/pull/3043>`_
0982
0983 * Fix ``pybind11_INCLUDE_DIR`` in case ``CMAKE_INSTALL_INCLUDEDIR`` is
0984 absolute.
0985 `#3005 <https://github.com/pybind/pybind11/pull/3005>`_
0986
0987 * Fix bug not respecting ``WITH_SOABI`` or ``WITHOUT_SOABI`` to CMake.
0988 `#2938 <https://github.com/pybind/pybind11/pull/2938>`_
0989
0990 * Fix the default ``Pybind11Extension`` compilation flags with a Mingw64 python.
0991 `#2921 <https://github.com/pybind/pybind11/pull/2921>`_
0992
0993 * Clang on Windows: do not pass ``/MP`` (ignored flag).
0994 `#2824 <https://github.com/pybind/pybind11/pull/2824>`_
0995
0996 * ``pybind11.setup_helpers.intree_extensions`` can be used to generate
0997 ``Pybind11Extension`` instances from cpp files placed in the Python package
0998 source tree.
0999 `#2831 <https://github.com/pybind/pybind11/pull/2831>`_
1000
1001 Backend and tidying up:
1002
1003 * Enable clang-tidy performance, readability, and modernization checks
1004 throughout the codebase to enforce best coding practices.
1005 `#3046 <https://github.com/pybind/pybind11/pull/3046>`_,
1006 `#3049 <https://github.com/pybind/pybind11/pull/3049>`_,
1007 `#3051 <https://github.com/pybind/pybind11/pull/3051>`_,
1008 `#3052 <https://github.com/pybind/pybind11/pull/3052>`_,
1009 `#3080 <https://github.com/pybind/pybind11/pull/3080>`_, and
1010 `#3094 <https://github.com/pybind/pybind11/pull/3094>`_
1011
1012
1013 * Checks for common misspellings were added to the pre-commit hooks.
1014 `#3076 <https://github.com/pybind/pybind11/pull/3076>`_
1015
1016 * Changed ``Werror`` to stricter ``Werror-all`` for Intel compiler and fixed
1017 minor issues.
1018 `#2948 <https://github.com/pybind/pybind11/pull/2948>`_
1019
1020 * Fixed compilation with GCC < 5 when the user defines ``_GLIBCXX_USE_CXX11_ABI``.
1021 `#2956 <https://github.com/pybind/pybind11/pull/2956>`_
1022
1023 * Added nox support for easier local testing and linting of contributions.
1024 `#3101 <https://github.com/pybind/pybind11/pull/3101>`_ and
1025 `#3121 <https://github.com/pybind/pybind11/pull/3121>`_
1026
1027 * Avoid RTD style issue with docutils 0.17+.
1028 `#3119 <https://github.com/pybind/pybind11/pull/3119>`_
1029
1030 * Support pipx run, such as ``pipx run pybind11 --include`` for a quick compile.
1031 `#3117 <https://github.com/pybind/pybind11/pull/3117>`_
1032
1033
1034
1035 v2.6.2 (Jan 26, 2021)
1036 ---------------------
1037
1038 Minor missing functionality added:
1039
1040 * enum: add missing Enum.value property.
1041 `#2739 <https://github.com/pybind/pybind11/pull/2739>`_
1042
1043 * Allow thread termination to be avoided during shutdown for CPython 3.7+ via
1044 ``.disarm`` for ``gil_scoped_acquire``/``gil_scoped_release``.
1045 `#2657 <https://github.com/pybind/pybind11/pull/2657>`_
1046
1047 Fixed or improved behavior in a few special cases:
1048
1049 * Fix bug where the constructor of ``object`` subclasses would not throw on
1050 being passed a Python object of the wrong type.
1051 `#2701 <https://github.com/pybind/pybind11/pull/2701>`_
1052
1053 * The ``type_caster`` for integers does not convert Python objects with
1054 ``__int__`` anymore with ``noconvert`` or during the first round of trying
1055 overloads.
1056 `#2698 <https://github.com/pybind/pybind11/pull/2698>`_
1057
1058 * When casting to a C++ integer, ``__index__`` is always called and not
1059 considered as conversion, consistent with Python 3.8+.
1060 `#2801 <https://github.com/pybind/pybind11/pull/2801>`_
1061
1062 Build improvements:
1063
1064 * Setup helpers: ``extra_compile_args`` and ``extra_link_args`` automatically set by
1065 Pybind11Extension are now prepended, which allows them to be overridden
1066 by user-set ``extra_compile_args`` and ``extra_link_args``.
1067 `#2808 <https://github.com/pybind/pybind11/pull/2808>`_
1068
1069 * Setup helpers: Don't trigger unused parameter warning.
1070 `#2735 <https://github.com/pybind/pybind11/pull/2735>`_
1071
1072 * CMake: Support running with ``--warn-uninitialized`` active.
1073 `#2806 <https://github.com/pybind/pybind11/pull/2806>`_
1074
1075 * CMake: Avoid error if included from two submodule directories.
1076 `#2804 <https://github.com/pybind/pybind11/pull/2804>`_
1077
1078 * CMake: Fix ``STATIC`` / ``SHARED`` being ignored in FindPython mode.
1079 `#2796 <https://github.com/pybind/pybind11/pull/2796>`_
1080
1081 * CMake: Respect the setting for ``CMAKE_CXX_VISIBILITY_PRESET`` if defined.
1082 `#2793 <https://github.com/pybind/pybind11/pull/2793>`_
1083
1084 * CMake: Fix issue with FindPython2/FindPython3 not working with ``pybind11::embed``.
1085 `#2662 <https://github.com/pybind/pybind11/pull/2662>`_
1086
1087 * CMake: mixing local and installed pybind11's would prioritize the installed
1088 one over the local one (regression in 2.6.0).
1089 `#2716 <https://github.com/pybind/pybind11/pull/2716>`_
1090
1091
1092 Bug fixes:
1093
1094 * Fixed segfault in multithreaded environments when using
1095 ``scoped_ostream_redirect``.
1096 `#2675 <https://github.com/pybind/pybind11/pull/2675>`_
1097
1098 * Leave docstring unset when all docstring-related options are disabled, rather
1099 than set an empty string.
1100 `#2745 <https://github.com/pybind/pybind11/pull/2745>`_
1101
1102 * The module key in builtins that pybind11 uses to store its internals changed
1103 from std::string to a python str type (more natural on Python 2, no change on
1104 Python 3).
1105 `#2814 <https://github.com/pybind/pybind11/pull/2814>`_
1106
1107 * Fixed assertion error related to unhandled (later overwritten) exception in
1108 CPython 3.8 and 3.9 debug builds.
1109 `#2685 <https://github.com/pybind/pybind11/pull/2685>`_
1110
1111 * Fix ``py::gil_scoped_acquire`` assert with CPython 3.9 debug build.
1112 `#2683 <https://github.com/pybind/pybind11/pull/2683>`_
1113
1114 * Fix issue with a test failing on pytest 6.2.
1115 `#2741 <https://github.com/pybind/pybind11/pull/2741>`_
1116
1117 Warning fixes:
1118
1119 * Fix warning modifying constructor parameter 'flag' that shadows a field of
1120 'set_flag' ``[-Wshadow-field-in-constructor-modified]``.
1121 `#2780 <https://github.com/pybind/pybind11/pull/2780>`_
1122
1123 * Suppressed some deprecation warnings about old-style
1124 ``__init__``/``__setstate__`` in the tests.
1125 `#2759 <https://github.com/pybind/pybind11/pull/2759>`_
1126
1127 Valgrind work:
1128
1129 * Fix invalid access when calling a pybind11 ``__init__`` on a non-pybind11
1130 class instance.
1131 `#2755 <https://github.com/pybind/pybind11/pull/2755>`_
1132
1133 * Fixed various minor memory leaks in pybind11's test suite.
1134 `#2758 <https://github.com/pybind/pybind11/pull/2758>`_
1135
1136 * Resolved memory leak in cpp_function initialization when exceptions occurred.
1137 `#2756 <https://github.com/pybind/pybind11/pull/2756>`_
1138
1139 * Added a Valgrind build, checking for leaks and memory-related UB, to CI.
1140 `#2746 <https://github.com/pybind/pybind11/pull/2746>`_
1141
1142 Compiler support:
1143
1144 * Intel compiler was not activating C++14 support due to a broken define.
1145 `#2679 <https://github.com/pybind/pybind11/pull/2679>`_
1146
1147 * Support ICC and NVIDIA HPC SDK in C++17 mode.
1148 `#2729 <https://github.com/pybind/pybind11/pull/2729>`_
1149
1150 * Support Intel OneAPI compiler (ICC 20.2) and add to CI.
1151 `#2573 <https://github.com/pybind/pybind11/pull/2573>`_
1152
1153
1154
1155 v2.6.1 (Nov 11, 2020)
1156 ---------------------
1157
1158 * ``py::exec``, ``py::eval``, and ``py::eval_file`` now add the builtins module
1159 as ``"__builtins__"`` to their ``globals`` argument, better matching ``exec``
1160 and ``eval`` in pure Python.
1161 `#2616 <https://github.com/pybind/pybind11/pull/2616>`_
1162
1163 * ``setup_helpers`` will no longer set a minimum macOS version higher than the
1164 current version.
1165 `#2622 <https://github.com/pybind/pybind11/pull/2622>`_
1166
1167 * Allow deleting static properties.
1168 `#2629 <https://github.com/pybind/pybind11/pull/2629>`_
1169
1170 * Seal a leak in ``def_buffer``, cleaning up the ``capture`` object after the
1171 ``class_`` object goes out of scope.
1172 `#2634 <https://github.com/pybind/pybind11/pull/2634>`_
1173
1174 * ``pybind11_INCLUDE_DIRS`` was incorrect, potentially causing a regression if
1175 it was expected to include ``PYTHON_INCLUDE_DIRS`` (please use targets
1176 instead).
1177 `#2636 <https://github.com/pybind/pybind11/pull/2636>`_
1178
1179 * Added parameter names to the ``py::enum_`` constructor and methods, avoiding
1180 ``arg0`` in the generated docstrings.
1181 `#2637 <https://github.com/pybind/pybind11/pull/2637>`_
1182
1183 * Added ``needs_recompile`` optional function to the ``ParallelCompiler``
1184 helper, to allow a recompile to be skipped based on a user-defined function.
1185 `#2643 <https://github.com/pybind/pybind11/pull/2643>`_
1186
1187
1188 v2.6.0 (Oct 21, 2020)
1189 ---------------------
1190
1191 See :ref:`upgrade-guide-2.6` for help upgrading to the new version.
1192
1193 New features:
1194
1195 * Keyword-only arguments supported in Python 2 or 3 with ``py::kw_only()``.
1196 `#2100 <https://github.com/pybind/pybind11/pull/2100>`_
1197
1198 * Positional-only arguments supported in Python 2 or 3 with ``py::pos_only()``.
1199 `#2459 <https://github.com/pybind/pybind11/pull/2459>`_
1200
1201 * ``py::is_final()`` class modifier to block subclassing (CPython only).
1202 `#2151 <https://github.com/pybind/pybind11/pull/2151>`_
1203
1204 * Added ``py::prepend()``, allowing a function to be placed at the beginning of
1205 the overload chain.
1206 `#1131 <https://github.com/pybind/pybind11/pull/1131>`_
1207
1208 * Access to the type object now provided with ``py::type::of<T>()`` and
1209 ``py::type::of(h)``.
1210 `#2364 <https://github.com/pybind/pybind11/pull/2364>`_
1211
1212 * Perfect forwarding support for methods.
1213 `#2048 <https://github.com/pybind/pybind11/pull/2048>`_
1214
1215 * Added ``py::error_already_set::discard_as_unraisable()``.
1216 `#2372 <https://github.com/pybind/pybind11/pull/2372>`_
1217
1218 * ``py::hash`` is now public.
1219 `#2217 <https://github.com/pybind/pybind11/pull/2217>`_
1220
1221 * ``py::class_<union_type>`` is now supported. Note that writing to one data
1222 member of the union and reading another (type punning) is UB in C++. Thus
1223 pybind11-bound enums should never be used for such conversions.
1224 `#2320 <https://github.com/pybind/pybind11/pull/2320>`_.
1225
1226 * Classes now check local scope when registering members, allowing a subclass
1227 to have a member with the same name as a parent (such as an enum).
1228 `#2335 <https://github.com/pybind/pybind11/pull/2335>`_
1229
1230 Code correctness features:
1231
1232 * Error now thrown when ``__init__`` is forgotten on subclasses.
1233 `#2152 <https://github.com/pybind/pybind11/pull/2152>`_
1234
1235 * Throw error if conversion to a pybind11 type if the Python object isn't a
1236 valid instance of that type, such as ``py::bytes(o)`` when ``py::object o``
1237 isn't a bytes instance.
1238 `#2349 <https://github.com/pybind/pybind11/pull/2349>`_
1239
1240 * Throw if conversion to ``str`` fails.
1241 `#2477 <https://github.com/pybind/pybind11/pull/2477>`_
1242
1243
1244 API changes:
1245
1246 * ``py::module`` was renamed ``py::module_`` to avoid issues with C++20 when
1247 used unqualified, but an alias ``py::module`` is provided for backward
1248 compatibility.
1249 `#2489 <https://github.com/pybind/pybind11/pull/2489>`_
1250
1251 * Public constructors for ``py::module_`` have been deprecated; please use
1252 ``pybind11::module_::create_extension_module`` if you were using the public
1253 constructor (fairly rare after ``PYBIND11_MODULE`` was introduced).
1254 `#2552 <https://github.com/pybind/pybind11/pull/2552>`_
1255
1256 * ``PYBIND11_OVERLOAD*`` macros and ``get_overload`` function replaced by
1257 correctly-named ``PYBIND11_OVERRIDE*`` and ``get_override``, fixing
1258 inconsistencies in the presence of a closing ``;`` in these macros.
1259 ``get_type_overload`` is deprecated.
1260 `#2325 <https://github.com/pybind/pybind11/pull/2325>`_
1261
1262 Packaging / building improvements:
1263
1264 * The Python package was reworked to be more powerful and useful.
1265 `#2433 <https://github.com/pybind/pybind11/pull/2433>`_
1266
1267 * :ref:`build-setuptools` is easier thanks to a new
1268 ``pybind11.setup_helpers`` module, which provides utilities to use
1269 setuptools with pybind11. It can be used via PEP 518, ``setup_requires``,
1270 or by directly importing or copying ``setup_helpers.py`` into your project.
1271
1272 * CMake configuration files are now included in the Python package. Use
1273 ``pybind11.get_cmake_dir()`` or ``python -m pybind11 --cmakedir`` to get
1274 the directory with the CMake configuration files, or include the
1275 site-packages location in your ``CMAKE_MODULE_PATH``. Or you can use the
1276 new ``pybind11[global]`` extra when you install ``pybind11``, which
1277 installs the CMake files and headers into your base environment in the
1278 standard location.
1279
1280 * ``pybind11-config`` is another way to write ``python -m pybind11`` if you
1281 have your PATH set up.
1282
1283 * Added external typing support to the helper module, code from
1284 ``import pybind11`` can now be type checked.
1285 `#2588 <https://github.com/pybind/pybind11/pull/2588>`_
1286
1287 * Minimum CMake required increased to 3.4.
1288 `#2338 <https://github.com/pybind/pybind11/pull/2338>`_ and
1289 `#2370 <https://github.com/pybind/pybind11/pull/2370>`_
1290
1291 * Full integration with CMake's C++ standard system and compile features
1292 replaces ``PYBIND11_CPP_STANDARD``.
1293
1294 * Generated config file is now portable to different Python/compiler/CMake
1295 versions.
1296
1297 * Virtual environments prioritized if ``PYTHON_EXECUTABLE`` is not set
1298 (``venv``, ``virtualenv``, and ``conda``) (similar to the new FindPython
1299 mode).
1300
1301 * Other CMake features now natively supported, like
1302 ``CMAKE_INTERPROCEDURAL_OPTIMIZATION``, ``set(CMAKE_CXX_VISIBILITY_PRESET
1303 hidden)``.
1304
1305 * ``CUDA`` as a language is now supported.
1306
1307 * Helper functions ``pybind11_strip``, ``pybind11_extension``,
1308 ``pybind11_find_import`` added, see :doc:`cmake/index`.
1309
1310 * Optional :ref:`find-python-mode` and :ref:`nopython-mode` with CMake.
1311 `#2370 <https://github.com/pybind/pybind11/pull/2370>`_
1312
1313 * Uninstall target added.
1314 `#2265 <https://github.com/pybind/pybind11/pull/2265>`_ and
1315 `#2346 <https://github.com/pybind/pybind11/pull/2346>`_
1316
1317 * ``pybind11_add_module()`` now accepts an optional ``OPT_SIZE`` flag that
1318 switches the binding target to size-based optimization if the global build
1319 type can not always be fixed to ``MinSizeRel`` (except in debug mode, where
1320 optimizations remain disabled). ``MinSizeRel`` or this flag reduces binary
1321 size quite substantially (~25% on some platforms).
1322 `#2463 <https://github.com/pybind/pybind11/pull/2463>`_
1323
1324 Smaller or developer focused features and fixes:
1325
1326 * Moved ``mkdoc.py`` to a new repo, `pybind11-mkdoc`_. There are no longer
1327 submodules in the main repo.
1328
1329 * ``py::memoryview`` segfault fix and update, with new
1330 ``py::memoryview::from_memory`` in Python 3, and documentation.
1331 `#2223 <https://github.com/pybind/pybind11/pull/2223>`_
1332
1333 * Fix for ``buffer_info`` on Python 2.
1334 `#2503 <https://github.com/pybind/pybind11/pull/2503>`_
1335
1336 * If ``__eq__`` defined but not ``__hash__``, ``__hash__`` is now set to
1337 ``None``.
1338 `#2291 <https://github.com/pybind/pybind11/pull/2291>`_
1339
1340 * ``py::ellipsis`` now also works on Python 2.
1341 `#2360 <https://github.com/pybind/pybind11/pull/2360>`_
1342
1343 * Pointer to ``std::tuple`` & ``std::pair`` supported in cast.
1344 `#2334 <https://github.com/pybind/pybind11/pull/2334>`_
1345
1346 * Small fixes in NumPy support. ``py::array`` now uses ``py::ssize_t`` as first
1347 argument type.
1348 `#2293 <https://github.com/pybind/pybind11/pull/2293>`_
1349
1350 * Added missing signature for ``py::array``.
1351 `#2363 <https://github.com/pybind/pybind11/pull/2363>`_
1352
1353 * ``unchecked_mutable_reference`` has access to operator ``()`` and ``[]`` when
1354 const.
1355 `#2514 <https://github.com/pybind/pybind11/pull/2514>`_
1356
1357 * ``py::vectorize`` is now supported on functions that return void.
1358 `#1969 <https://github.com/pybind/pybind11/pull/1969>`_
1359
1360 * ``py::capsule`` supports ``get_pointer`` and ``set_pointer``.
1361 `#1131 <https://github.com/pybind/pybind11/pull/1131>`_
1362
1363 * Fix crash when different instances share the same pointer of the same type.
1364 `#2252 <https://github.com/pybind/pybind11/pull/2252>`_
1365
1366 * Fix for ``py::len`` not clearing Python's error state when it fails and throws.
1367 `#2575 <https://github.com/pybind/pybind11/pull/2575>`_
1368
1369 * Bugfixes related to more extensive testing, new GitHub Actions CI.
1370 `#2321 <https://github.com/pybind/pybind11/pull/2321>`_
1371
1372 * Bug in timezone issue in Eastern hemisphere midnight fixed.
1373 `#2438 <https://github.com/pybind/pybind11/pull/2438>`_
1374
1375 * ``std::chrono::time_point`` now works when the resolution is not the same as
1376 the system.
1377 `#2481 <https://github.com/pybind/pybind11/pull/2481>`_
1378
1379 * Bug fixed where ``py::array_t`` could accept arrays that did not match the
1380 requested ordering.
1381 `#2484 <https://github.com/pybind/pybind11/pull/2484>`_
1382
1383 * Avoid a segfault on some compilers when types are removed in Python.
1384 `#2564 <https://github.com/pybind/pybind11/pull/2564>`_
1385
1386 * ``py::arg::none()`` is now also respected when passing keyword arguments.
1387 `#2611 <https://github.com/pybind/pybind11/pull/2611>`_
1388
1389 * PyPy fixes, PyPy 7.3.x now supported, including PyPy3. (Known issue with
1390 PyPy2 and Windows `#2596 <https://github.com/pybind/pybind11/issues/2596>`_).
1391 `#2146 <https://github.com/pybind/pybind11/pull/2146>`_
1392
1393 * CPython 3.9.0 workaround for undefined behavior (macOS segfault).
1394 `#2576 <https://github.com/pybind/pybind11/pull/2576>`_
1395
1396 * CPython 3.9 warning fixes.
1397 `#2253 <https://github.com/pybind/pybind11/pull/2253>`_
1398
1399 * Improved C++20 support, now tested in CI.
1400 `#2489 <https://github.com/pybind/pybind11/pull/2489>`_
1401 `#2599 <https://github.com/pybind/pybind11/pull/2599>`_
1402
1403 * Improved but still incomplete debug Python interpreter support.
1404 `#2025 <https://github.com/pybind/pybind11/pull/2025>`_
1405
1406 * NVCC (CUDA 11) now supported and tested in CI.
1407 `#2461 <https://github.com/pybind/pybind11/pull/2461>`_
1408
1409 * NVIDIA PGI compilers now supported and tested in CI.
1410 `#2475 <https://github.com/pybind/pybind11/pull/2475>`_
1411
1412 * At least Intel 18 now explicitly required when compiling with Intel.
1413 `#2577 <https://github.com/pybind/pybind11/pull/2577>`_
1414
1415 * Extensive style checking in CI, with `pre-commit`_ support. Code
1416 modernization, checked by clang-tidy.
1417
1418 * Expanded docs, including new main page, new installing section, and CMake
1419 helpers page, along with over a dozen new sections on existing pages.
1420
1421 * In GitHub, new docs for contributing and new issue templates.
1422
1423 .. _pre-commit: https://pre-commit.com
1424
1425 .. _pybind11-mkdoc: https://github.com/pybind/pybind11-mkdoc
1426
1427 v2.5.0 (Mar 31, 2020)
1428 -----------------------------------------------------
1429
1430 * Use C++17 fold expressions in type casters, if available. This can
1431 improve performance during overload resolution when functions have
1432 multiple arguments.
1433 `#2043 <https://github.com/pybind/pybind11/pull/2043>`_.
1434
1435 * Changed include directory resolution in ``pybind11/__init__.py``
1436 and installation in ``setup.py``. This fixes a number of open issues
1437 where pybind11 headers could not be found in certain environments.
1438 `#1995 <https://github.com/pybind/pybind11/pull/1995>`_.
1439
1440 * C++20 ``char8_t`` and ``u8string`` support. `#2026
1441 <https://github.com/pybind/pybind11/pull/2026>`_.
1442
1443 * CMake: search for Python 3.9. `bb9c91
1444 <https://github.com/pybind/pybind11/commit/bb9c91>`_.
1445
1446 * Fixes for MSYS-based build environments.
1447 `#2087 <https://github.com/pybind/pybind11/pull/2087>`_,
1448 `#2053 <https://github.com/pybind/pybind11/pull/2053>`_.
1449
1450 * STL bindings for ``std::vector<...>::clear``. `#2074
1451 <https://github.com/pybind/pybind11/pull/2074>`_.
1452
1453 * Read-only flag for ``py::buffer``. `#1466
1454 <https://github.com/pybind/pybind11/pull/1466>`_.
1455
1456 * Exception handling during module initialization.
1457 `bf2b031 <https://github.com/pybind/pybind11/commit/bf2b031>`_.
1458
1459 * Support linking against a CPython debug build.
1460 `#2025 <https://github.com/pybind/pybind11/pull/2025>`_.
1461
1462 * Fixed issues involving the availability and use of aligned ``new`` and
1463 ``delete``. `#1988 <https://github.com/pybind/pybind11/pull/1988>`_,
1464 `759221 <https://github.com/pybind/pybind11/commit/759221>`_.
1465
1466 * Fixed a resource leak upon interpreter shutdown.
1467 `#2020 <https://github.com/pybind/pybind11/pull/2020>`_.
1468
1469 * Fixed error handling in the boolean caster.
1470 `#1976 <https://github.com/pybind/pybind11/pull/1976>`_.
1471
1472 v2.4.3 (Oct 15, 2019)
1473 -----------------------------------------------------
1474
1475 * Adapt pybind11 to a C API convention change in Python 3.8. `#1950
1476 <https://github.com/pybind/pybind11/pull/1950>`_.
1477
1478 v2.4.2 (Sep 21, 2019)
1479 -----------------------------------------------------
1480
1481 * Replaced usage of a C++14 only construct. `#1929
1482 <https://github.com/pybind/pybind11/pull/1929>`_.
1483
1484 * Made an ifdef future-proof for Python >= 4. `f3109d
1485 <https://github.com/pybind/pybind11/commit/f3109d>`_.
1486
1487 v2.4.1 (Sep 20, 2019)
1488 -----------------------------------------------------
1489
1490 * Fixed a problem involving implicit conversion from enumerations to integers
1491 on Python 3.8. `#1780 <https://github.com/pybind/pybind11/pull/1780>`_.
1492
1493 v2.4.0 (Sep 19, 2019)
1494 -----------------------------------------------------
1495
1496 * Try harder to keep pybind11-internal data structures separate when there
1497 are potential ABI incompatibilities. Fixes crashes that occurred when loading
1498 multiple pybind11 extensions that were e.g. compiled by GCC (libstdc++)
1499 and Clang (libc++).
1500 `#1588 <https://github.com/pybind/pybind11/pull/1588>`_ and
1501 `c9f5a <https://github.com/pybind/pybind11/commit/c9f5a>`_.
1502
1503 * Added support for ``__await__``, ``__aiter__``, and ``__anext__`` protocols.
1504 `#1842 <https://github.com/pybind/pybind11/pull/1842>`_.
1505
1506 * ``pybind11_add_module()``: don't strip symbols when compiling in
1507 ``RelWithDebInfo`` mode. `#1980
1508 <https://github.com/pybind/pybind11/pull/1980>`_.
1509
1510 * ``enum_``: Reproduce Python behavior when comparing against invalid values
1511 (e.g. ``None``, strings, etc.). Add back support for ``__invert__()``.
1512 `#1912 <https://github.com/pybind/pybind11/pull/1912>`_,
1513 `#1907 <https://github.com/pybind/pybind11/pull/1907>`_.
1514
1515 * List insertion operation for ``py::list``.
1516 Added ``.empty()`` to all collection types.
1517 Added ``py::set::contains()`` and ``py::dict::contains()``.
1518 `#1887 <https://github.com/pybind/pybind11/pull/1887>`_,
1519 `#1884 <https://github.com/pybind/pybind11/pull/1884>`_,
1520 `#1888 <https://github.com/pybind/pybind11/pull/1888>`_.
1521
1522 * ``py::details::overload_cast_impl`` is available in C++11 mode, can be used
1523 like ``overload_cast`` with an additional set of parentheses.
1524 `#1581 <https://github.com/pybind/pybind11/pull/1581>`_.
1525
1526 * Fixed ``get_include()`` on Conda.
1527 `#1877 <https://github.com/pybind/pybind11/pull/1877>`_.
1528
1529 * ``stl_bind.h``: negative indexing support.
1530 `#1882 <https://github.com/pybind/pybind11/pull/1882>`_.
1531
1532 * Minor CMake fix to add MinGW compatibility.
1533 `#1851 <https://github.com/pybind/pybind11/pull/1851>`_.
1534
1535 * GIL-related fixes.
1536 `#1836 <https://github.com/pybind/pybind11/pull/1836>`_,
1537 `8b90b <https://github.com/pybind/pybind11/commit/8b90b>`_.
1538
1539 * Other very minor/subtle fixes and improvements.
1540 `#1329 <https://github.com/pybind/pybind11/pull/1329>`_,
1541 `#1910 <https://github.com/pybind/pybind11/pull/1910>`_,
1542 `#1863 <https://github.com/pybind/pybind11/pull/1863>`_,
1543 `#1847 <https://github.com/pybind/pybind11/pull/1847>`_,
1544 `#1890 <https://github.com/pybind/pybind11/pull/1890>`_,
1545 `#1860 <https://github.com/pybind/pybind11/pull/1860>`_,
1546 `#1848 <https://github.com/pybind/pybind11/pull/1848>`_,
1547 `#1821 <https://github.com/pybind/pybind11/pull/1821>`_,
1548 `#1837 <https://github.com/pybind/pybind11/pull/1837>`_,
1549 `#1833 <https://github.com/pybind/pybind11/pull/1833>`_,
1550 `#1748 <https://github.com/pybind/pybind11/pull/1748>`_,
1551 `#1852 <https://github.com/pybind/pybind11/pull/1852>`_.
1552
1553 v2.3.0 (June 11, 2019)
1554 -----------------------------------------------------
1555
1556 * Significantly reduced module binary size (10-20%) when compiled in C++11 mode
1557 with GCC/Clang, or in any mode with MSVC. Function signatures are now always
1558 precomputed at compile time (this was previously only available in C++14 mode
1559 for non-MSVC compilers).
1560 `#934 <https://github.com/pybind/pybind11/pull/934>`_.
1561
1562 * Add basic support for tag-based static polymorphism, where classes
1563 provide a method to returns the desired type of an instance.
1564 `#1326 <https://github.com/pybind/pybind11/pull/1326>`_.
1565
1566 * Python type wrappers (``py::handle``, ``py::object``, etc.)
1567 now support map Python's number protocol onto C++ arithmetic
1568 operators such as ``operator+``, ``operator/=``, etc.
1569 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.
1570
1571 * A number of improvements related to enumerations:
1572
1573 1. The ``enum_`` implementation was rewritten from scratch to reduce
1574 code bloat. Rather than instantiating a full implementation for each
1575 enumeration, most code is now contained in a generic base class.
1576 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.
1577
1578 2. The ``value()`` method of ``py::enum_`` now accepts an optional
1579 docstring that will be shown in the documentation of the associated
1580 enumeration. `#1160 <https://github.com/pybind/pybind11/pull/1160>`_.
1581
1582 3. check for already existing enum value and throw an error if present.
1583 `#1453 <https://github.com/pybind/pybind11/pull/1453>`_.
1584
1585 * Support for over-aligned type allocation via C++17's aligned ``new``
1586 statement. `#1582 <https://github.com/pybind/pybind11/pull/1582>`_.
1587
1588 * Added ``py::ellipsis()`` method for slicing of multidimensional NumPy arrays
1589 `#1502 <https://github.com/pybind/pybind11/pull/1502>`_.
1590
1591 * Numerous Improvements to the ``mkdoc.py`` script for extracting documentation
1592 from C++ header files.
1593 `#1788 <https://github.com/pybind/pybind11/pull/1788>`_.
1594
1595 * ``pybind11_add_module()``: allow including Python as a ``SYSTEM`` include path.
1596 `#1416 <https://github.com/pybind/pybind11/pull/1416>`_.
1597
1598 * ``pybind11/stl.h`` does not convert strings to ``vector<string>`` anymore.
1599 `#1258 <https://github.com/pybind/pybind11/issues/1258>`_.
1600
1601 * Mark static methods as such to fix auto-generated Sphinx documentation.
1602 `#1732 <https://github.com/pybind/pybind11/pull/1732>`_.
1603
1604 * Re-throw forced unwind exceptions (e.g. during pthread termination).
1605 `#1208 <https://github.com/pybind/pybind11/pull/1208>`_.
1606
1607 * Added ``__contains__`` method to the bindings of maps (``std::map``,
1608 ``std::unordered_map``).
1609 `#1767 <https://github.com/pybind/pybind11/pull/1767>`_.
1610
1611 * Improvements to ``gil_scoped_acquire``.
1612 `#1211 <https://github.com/pybind/pybind11/pull/1211>`_.
1613
1614 * Type caster support for ``std::deque<T>``.
1615 `#1609 <https://github.com/pybind/pybind11/pull/1609>`_.
1616
1617 * Support for ``std::unique_ptr`` holders, whose deleters differ between a base and derived
1618 class. `#1353 <https://github.com/pybind/pybind11/pull/1353>`_.
1619
1620 * Construction of STL array/vector-like data structures from
1621 iterators. Added an ``extend()`` operation.
1622 `#1709 <https://github.com/pybind/pybind11/pull/1709>`_,
1623
1624 * CMake build system improvements for projects that include non-C++
1625 files (e.g. plain C, CUDA) in ``pybind11_add_module`` et al.
1626 `#1678 <https://github.com/pybind/pybind11/pull/1678>`_.
1627
1628 * Fixed asynchronous invocation and deallocation of Python functions
1629 wrapped in ``std::function``.
1630 `#1595 <https://github.com/pybind/pybind11/pull/1595>`_.
1631
1632 * Fixes regarding return value policy propagation in STL type casters.
1633 `#1603 <https://github.com/pybind/pybind11/pull/1603>`_.
1634
1635 * Fixed scoped enum comparisons.
1636 `#1571 <https://github.com/pybind/pybind11/pull/1571>`_.
1637
1638 * Fixed iostream redirection for code that releases the GIL.
1639 `#1368 <https://github.com/pybind/pybind11/pull/1368>`_,
1640
1641 * A number of CI-related fixes.
1642 `#1757 <https://github.com/pybind/pybind11/pull/1757>`_,
1643 `#1744 <https://github.com/pybind/pybind11/pull/1744>`_,
1644 `#1670 <https://github.com/pybind/pybind11/pull/1670>`_.
1645
1646 v2.2.4 (September 11, 2018)
1647 -----------------------------------------------------
1648
1649 * Use new Python 3.7 Thread Specific Storage (TSS) implementation if available.
1650 `#1454 <https://github.com/pybind/pybind11/pull/1454>`_,
1651 `#1517 <https://github.com/pybind/pybind11/pull/1517>`_.
1652
1653 * Fixes for newer MSVC versions and C++17 mode.
1654 `#1347 <https://github.com/pybind/pybind11/pull/1347>`_,
1655 `#1462 <https://github.com/pybind/pybind11/pull/1462>`_.
1656
1657 * Propagate return value policies to type-specific casters
1658 when casting STL containers.
1659 `#1455 <https://github.com/pybind/pybind11/pull/1455>`_.
1660
1661 * Allow ostream-redirection of more than 1024 characters.
1662 `#1479 <https://github.com/pybind/pybind11/pull/1479>`_.
1663
1664 * Set ``Py_DEBUG`` define when compiling against a debug Python build.
1665 `#1438 <https://github.com/pybind/pybind11/pull/1438>`_.
1666
1667 * Untangle integer logic in number type caster to work for custom
1668 types that may only be castable to a restricted set of builtin types.
1669 `#1442 <https://github.com/pybind/pybind11/pull/1442>`_.
1670
1671 * CMake build system: Remember Python version in cache file.
1672 `#1434 <https://github.com/pybind/pybind11/pull/1434>`_.
1673
1674 * Fix for custom smart pointers: use ``std::addressof`` to obtain holder
1675 address instead of ``operator&``.
1676 `#1435 <https://github.com/pybind/pybind11/pull/1435>`_.
1677
1678 * Properly report exceptions thrown during module initialization.
1679 `#1362 <https://github.com/pybind/pybind11/pull/1362>`_.
1680
1681 * Fixed a segmentation fault when creating empty-shaped NumPy array.
1682 `#1371 <https://github.com/pybind/pybind11/pull/1371>`_.
1683
1684 * The version of Intel C++ compiler must be >= 2017, and this is now checked by
1685 the header files. `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.
1686
1687 * A few minor typo fixes and improvements to the test suite, and
1688 patches that silence compiler warnings.
1689
1690 * Vectors now support construction from generators, as well as ``extend()`` from a
1691 list or generator.
1692 `#1496 <https://github.com/pybind/pybind11/pull/1496>`_.
1693
1694
1695 v2.2.3 (April 29, 2018)
1696 -----------------------------------------------------
1697
1698 * The pybind11 header location detection was replaced by a new implementation
1699 that no longer depends on ``pip`` internals (the recently released ``pip``
1700 10 has restricted access to this API).
1701 `#1190 <https://github.com/pybind/pybind11/pull/1190>`_.
1702
1703 * Small adjustment to an implementation detail to work around a compiler segmentation fault in Clang 3.3/3.4.
1704 `#1350 <https://github.com/pybind/pybind11/pull/1350>`_.
1705
1706 * The minimal supported version of the Intel compiler was >= 17.0 since
1707 pybind11 v2.1. This check is now explicit, and a compile-time error is raised
1708 if the compiler meet the requirement.
1709 `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.
1710
1711 * Fixed an endianness-related fault in the test suite.
1712 `#1287 <https://github.com/pybind/pybind11/pull/1287>`_.
1713
1714 v2.2.2 (February 7, 2018)
1715 -----------------------------------------------------
1716
1717 * Fixed a segfault when combining embedded interpreter
1718 shutdown/reinitialization with external loaded pybind11 modules.
1719 `#1092 <https://github.com/pybind/pybind11/pull/1092>`_.
1720
1721 * Eigen support: fixed a bug where Nx1/1xN numpy inputs couldn't be passed as
1722 arguments to Eigen vectors (which for Eigen are simply compile-time fixed
1723 Nx1/1xN matrices).
1724 `#1106 <https://github.com/pybind/pybind11/pull/1106>`_.
1725
1726 * Clarified to license by moving the licensing of contributions from
1727 ``LICENSE`` into ``CONTRIBUTING.md``: the licensing of contributions is not
1728 actually part of the software license as distributed. This isn't meant to be
1729 a substantial change in the licensing of the project, but addresses concerns
1730 that the clause made the license non-standard.
1731 `#1109 <https://github.com/pybind/pybind11/issues/1109>`_.
1732
1733 * Fixed a regression introduced in 2.1 that broke binding functions with lvalue
1734 character literal arguments.
1735 `#1128 <https://github.com/pybind/pybind11/pull/1128>`_.
1736
1737 * MSVC: fix for compilation failures under /permissive-, and added the flag to
1738 the appveyor test suite.
1739 `#1155 <https://github.com/pybind/pybind11/pull/1155>`_.
1740
1741 * Fixed ``__qualname__`` generation, and in turn, fixes how class names
1742 (especially nested class names) are shown in generated docstrings.
1743 `#1171 <https://github.com/pybind/pybind11/pull/1171>`_.
1744
1745 * Updated the FAQ with a suggested project citation reference.
1746 `#1189 <https://github.com/pybind/pybind11/pull/1189>`_.
1747
1748 * Added fixes for deprecation warnings when compiled under C++17 with
1749 ``-Wdeprecated`` turned on, and add ``-Wdeprecated`` to the test suite
1750 compilation flags.
1751 `#1191 <https://github.com/pybind/pybind11/pull/1191>`_.
1752
1753 * Fixed outdated PyPI URLs in ``setup.py``.
1754 `#1213 <https://github.com/pybind/pybind11/pull/1213>`_.
1755
1756 * Fixed a refcount leak for arguments that end up in a ``py::args`` argument
1757 for functions with both fixed positional and ``py::args`` arguments.
1758 `#1216 <https://github.com/pybind/pybind11/pull/1216>`_.
1759
1760 * Fixed a potential segfault resulting from possible premature destruction of
1761 ``py::args``/``py::kwargs`` arguments with overloaded functions.
1762 `#1223 <https://github.com/pybind/pybind11/pull/1223>`_.
1763
1764 * Fixed ``del map[item]`` for a ``stl_bind.h`` bound stl map.
1765 `#1229 <https://github.com/pybind/pybind11/pull/1229>`_.
1766
1767 * Fixed a regression from v2.1.x where the aggregate initialization could
1768 unintentionally end up at a constructor taking a templated
1769 ``std::initializer_list<T>`` argument.
1770 `#1249 <https://github.com/pybind/pybind11/pull/1249>`_.
1771
1772 * Fixed an issue where calling a function with a keep_alive policy on the same
1773 nurse/patient pair would cause the internal patient storage to needlessly
1774 grow (unboundedly, if the nurse is long-lived).
1775 `#1251 <https://github.com/pybind/pybind11/issues/1251>`_.
1776
1777 * Various other minor fixes.
1778
1779 v2.2.1 (September 14, 2017)
1780 -----------------------------------------------------
1781
1782 * Added ``py::module_::reload()`` member function for reloading a module.
1783 `#1040 <https://github.com/pybind/pybind11/pull/1040>`_.
1784
1785 * Fixed a reference leak in the number converter.
1786 `#1078 <https://github.com/pybind/pybind11/pull/1078>`_.
1787
1788 * Fixed compilation with Clang on host GCC < 5 (old libstdc++ which isn't fully
1789 C++11 compliant). `#1062 <https://github.com/pybind/pybind11/pull/1062>`_.
1790
1791 * Fixed a regression where the automatic ``std::vector<bool>`` caster would
1792 fail to compile. The same fix also applies to any container which returns
1793 element proxies instead of references.
1794 `#1053 <https://github.com/pybind/pybind11/pull/1053>`_.
1795
1796 * Fixed a regression where the ``py::keep_alive`` policy could not be applied
1797 to constructors. `#1065 <https://github.com/pybind/pybind11/pull/1065>`_.
1798
1799 * Fixed a nullptr dereference when loading a ``py::module_local`` type
1800 that's only registered in an external module.
1801 `#1058 <https://github.com/pybind/pybind11/pull/1058>`_.
1802
1803 * Fixed implicit conversion of accessors to types derived from ``py::object``.
1804 `#1076 <https://github.com/pybind/pybind11/pull/1076>`_.
1805
1806 * The ``name`` in ``PYBIND11_MODULE(name, variable)`` can now be a macro.
1807 `#1082 <https://github.com/pybind/pybind11/pull/1082>`_.
1808
1809 * Relaxed overly strict ``py::pickle()`` check for matching get and set types.
1810 `#1064 <https://github.com/pybind/pybind11/pull/1064>`_.
1811
1812 * Conversion errors now try to be more informative when it's likely that
1813 a missing header is the cause (e.g. forgetting ``<pybind11/stl.h>``).
1814 `#1077 <https://github.com/pybind/pybind11/pull/1077>`_.
1815
1816 v2.2.0 (August 31, 2017)
1817 -----------------------------------------------------
1818
1819 * Support for embedding the Python interpreter. See the
1820 :doc:`documentation page </advanced/embedding>` for a
1821 full overview of the new features.
1822 `#774 <https://github.com/pybind/pybind11/pull/774>`_,
1823 `#889 <https://github.com/pybind/pybind11/pull/889>`_,
1824 `#892 <https://github.com/pybind/pybind11/pull/892>`_,
1825 `#920 <https://github.com/pybind/pybind11/pull/920>`_.
1826
1827 .. code-block:: cpp
1828
1829 #include <pybind11/embed.h>
1830 namespace py = pybind11;
1831
1832 int main() {
1833 py::scoped_interpreter guard{}; // start the interpreter and keep it alive
1834
1835 py::print("Hello, World!"); // use the Python API
1836 }
1837
1838 * Support for inheriting from multiple C++ bases in Python.
1839 `#693 <https://github.com/pybind/pybind11/pull/693>`_.
1840
1841 .. code-block:: python
1842
1843 from cpp_module import CppBase1, CppBase2
1844
1845
1846 class PyDerived(CppBase1, CppBase2):
1847 def __init__(self):
1848 CppBase1.__init__(self) # C++ bases must be initialized explicitly
1849 CppBase2.__init__(self)
1850
1851 * ``PYBIND11_MODULE`` is now the preferred way to create module entry points.
1852 ``PYBIND11_PLUGIN`` is deprecated. See :ref:`macros` for details.
1853 `#879 <https://github.com/pybind/pybind11/pull/879>`_.
1854
1855 .. code-block:: cpp
1856
1857 // new
1858 PYBIND11_MODULE(example, m) {
1859 m.def("add", [](int a, int b) { return a + b; });
1860 }
1861
1862 // old
1863 PYBIND11_PLUGIN(example) {
1864 py::module m("example");
1865 m.def("add", [](int a, int b) { return a + b; });
1866 return m.ptr();
1867 }
1868
1869 * pybind11's headers and build system now more strictly enforce hidden symbol
1870 visibility for extension modules. This should be seamless for most users,
1871 but see the :doc:`upgrade` if you use a custom build system.
1872 `#995 <https://github.com/pybind/pybind11/pull/995>`_.
1873
1874 * Support for ``py::module_local`` types which allow multiple modules to
1875 export the same C++ types without conflicts. This is useful for opaque
1876 types like ``std::vector<int>``. ``py::bind_vector`` and ``py::bind_map``
1877 now default to ``py::module_local`` if their elements are builtins or
1878 local types. See :ref:`module_local` for details.
1879 `#949 <https://github.com/pybind/pybind11/pull/949>`_,
1880 `#981 <https://github.com/pybind/pybind11/pull/981>`_,
1881 `#995 <https://github.com/pybind/pybind11/pull/995>`_,
1882 `#997 <https://github.com/pybind/pybind11/pull/997>`_.
1883
1884 * Custom constructors can now be added very easily using lambdas or factory
1885 functions which return a class instance by value, pointer or holder. This
1886 supersedes the old placement-new ``__init__`` technique.
1887 See :ref:`custom_constructors` for details.
1888 `#805 <https://github.com/pybind/pybind11/pull/805>`_,
1889 `#1014 <https://github.com/pybind/pybind11/pull/1014>`_.
1890
1891 .. code-block:: cpp
1892
1893 struct Example {
1894 Example(std::string);
1895 };
1896
1897 py::class_<Example>(m, "Example")
1898 .def(py::init<std::string>()) // existing constructor
1899 .def(py::init([](int n) { // custom constructor
1900 return std::make_unique<Example>(std::to_string(n));
1901 }));
1902
1903 * Similarly to custom constructors, pickling support functions are now bound
1904 using the ``py::pickle()`` adaptor which improves type safety. See the
1905 :doc:`upgrade` and :ref:`pickling` for details.
1906 `#1038 <https://github.com/pybind/pybind11/pull/1038>`_.
1907
1908 * Builtin support for converting C++17 standard library types and general
1909 conversion improvements:
1910
1911 1. C++17 ``std::variant`` is supported right out of the box. C++11/14
1912 equivalents (e.g. ``boost::variant``) can also be added with a simple
1913 user-defined specialization. See :ref:`cpp17_container_casters` for details.
1914 `#811 <https://github.com/pybind/pybind11/pull/811>`_,
1915 `#845 <https://github.com/pybind/pybind11/pull/845>`_,
1916 `#989 <https://github.com/pybind/pybind11/pull/989>`_.
1917
1918 2. Out-of-the-box support for C++17 ``std::string_view``.
1919 `#906 <https://github.com/pybind/pybind11/pull/906>`_.
1920
1921 3. Improved compatibility of the builtin ``optional`` converter.
1922 `#874 <https://github.com/pybind/pybind11/pull/874>`_.
1923
1924 4. The ``bool`` converter now accepts ``numpy.bool_`` and types which
1925 define ``__bool__`` (Python 3.x) or ``__nonzero__`` (Python 2.7).
1926 `#925 <https://github.com/pybind/pybind11/pull/925>`_.
1927
1928 5. C++-to-Python casters are now more efficient and move elements out
1929 of rvalue containers whenever possible.
1930 `#851 <https://github.com/pybind/pybind11/pull/851>`_,
1931 `#936 <https://github.com/pybind/pybind11/pull/936>`_,
1932 `#938 <https://github.com/pybind/pybind11/pull/938>`_.
1933
1934 6. Fixed ``bytes`` to ``std::string/char*`` conversion on Python 3.
1935 `#817 <https://github.com/pybind/pybind11/pull/817>`_.
1936
1937 7. Fixed lifetime of temporary C++ objects created in Python-to-C++ conversions.
1938 `#924 <https://github.com/pybind/pybind11/pull/924>`_.
1939
1940 * Scope guard call policy for RAII types, e.g. ``py::call_guard<py::gil_scoped_release>()``,
1941 ``py::call_guard<py::scoped_ostream_redirect>()``. See :ref:`call_policies` for details.
1942 `#740 <https://github.com/pybind/pybind11/pull/740>`_.
1943
1944 * Utility for redirecting C++ streams to Python (e.g. ``std::cout`` ->
1945 ``sys.stdout``). Scope guard ``py::scoped_ostream_redirect`` in C++ and
1946 a context manager in Python. See :ref:`ostream_redirect`.
1947 `#1009 <https://github.com/pybind/pybind11/pull/1009>`_.
1948
1949 * Improved handling of types and exceptions across module boundaries.
1950 `#915 <https://github.com/pybind/pybind11/pull/915>`_,
1951 `#951 <https://github.com/pybind/pybind11/pull/951>`_,
1952 `#995 <https://github.com/pybind/pybind11/pull/995>`_.
1953
1954 * Fixed destruction order of ``py::keep_alive`` nurse/patient objects
1955 in reference cycles.
1956 `#856 <https://github.com/pybind/pybind11/pull/856>`_.
1957
1958 * NumPy and buffer protocol related improvements:
1959
1960 1. Support for negative strides in Python buffer objects/numpy arrays. This
1961 required changing integers from unsigned to signed for the related C++ APIs.
1962 Note: If you have compiler warnings enabled, you may notice some new conversion
1963 warnings after upgrading. These can be resolved with ``static_cast``.
1964 `#782 <https://github.com/pybind/pybind11/pull/782>`_.
1965
1966 2. Support ``std::complex`` and arrays inside ``PYBIND11_NUMPY_DTYPE``.
1967 `#831 <https://github.com/pybind/pybind11/pull/831>`_,
1968 `#832 <https://github.com/pybind/pybind11/pull/832>`_.
1969
1970 3. Support for constructing ``py::buffer_info`` and ``py::arrays`` using
1971 arbitrary containers or iterators instead of requiring a ``std::vector``.
1972 `#788 <https://github.com/pybind/pybind11/pull/788>`_,
1973 `#822 <https://github.com/pybind/pybind11/pull/822>`_,
1974 `#860 <https://github.com/pybind/pybind11/pull/860>`_.
1975
1976 4. Explicitly check numpy version and require >= 1.7.0.
1977 `#819 <https://github.com/pybind/pybind11/pull/819>`_.
1978
1979 * Support for allowing/prohibiting ``None`` for specific arguments and improved
1980 ``None`` overload resolution order. See :ref:`none_arguments` for details.
1981 `#843 <https://github.com/pybind/pybind11/pull/843>`_.
1982 `#859 <https://github.com/pybind/pybind11/pull/859>`_.
1983
1984 * Added ``py::exec()`` as a shortcut for ``py::eval<py::eval_statements>()``
1985 and support for C++11 raw string literals as input. See :ref:`eval`.
1986 `#766 <https://github.com/pybind/pybind11/pull/766>`_,
1987 `#827 <https://github.com/pybind/pybind11/pull/827>`_.
1988
1989 * ``py::vectorize()`` ignores non-vectorizable arguments and supports
1990 member functions.
1991 `#762 <https://github.com/pybind/pybind11/pull/762>`_.
1992
1993 * Support for bound methods as callbacks (``pybind11/functional.h``).
1994 `#815 <https://github.com/pybind/pybind11/pull/815>`_.
1995
1996 * Allow aliasing pybind11 methods: ``cls.attr("foo") = cls.attr("bar")``.
1997 `#802 <https://github.com/pybind/pybind11/pull/802>`_.
1998
1999 * Don't allow mixed static/non-static overloads.
2000 `#804 <https://github.com/pybind/pybind11/pull/804>`_.
2001
2002 * Fixed overriding static properties in derived classes.
2003 `#784 <https://github.com/pybind/pybind11/pull/784>`_.
2004
2005 * Added support for write only properties.
2006 `#1144 <https://github.com/pybind/pybind11/pull/1144>`_.
2007
2008 * Improved deduction of member functions of a derived class when its bases
2009 aren't registered with pybind11.
2010 `#855 <https://github.com/pybind/pybind11/pull/855>`_.
2011
2012 .. code-block:: cpp
2013
2014 struct Base {
2015 int foo() { return 42; }
2016 }
2017
2018 struct Derived : Base {}
2019
2020 // Now works, but previously required also binding `Base`
2021 py::class_<Derived>(m, "Derived")
2022 .def("foo", &Derived::foo); // function is actually from `Base`
2023
2024 * The implementation of ``py::init<>`` now uses C++11 brace initialization
2025 syntax to construct instances, which permits binding implicit constructors of
2026 aggregate types. `#1015 <https://github.com/pybind/pybind11/pull/1015>`_.
2027
2028 .. code-block:: cpp
2029
2030 struct Aggregate {
2031 int a;
2032 std::string b;
2033 };
2034
2035 py::class_<Aggregate>(m, "Aggregate")
2036 .def(py::init<int, const std::string &>());
2037
2038 * Fixed issues with multiple inheritance with offset base/derived pointers.
2039 `#812 <https://github.com/pybind/pybind11/pull/812>`_,
2040 `#866 <https://github.com/pybind/pybind11/pull/866>`_,
2041 `#960 <https://github.com/pybind/pybind11/pull/960>`_.
2042
2043 * Fixed reference leak of type objects.
2044 `#1030 <https://github.com/pybind/pybind11/pull/1030>`_.
2045
2046 * Improved support for the ``/std:c++14`` and ``/std:c++latest`` modes
2047 on MSVC 2017.
2048 `#841 <https://github.com/pybind/pybind11/pull/841>`_,
2049 `#999 <https://github.com/pybind/pybind11/pull/999>`_.
2050
2051 * Fixed detection of private operator new on MSVC.
2052 `#893 <https://github.com/pybind/pybind11/pull/893>`_,
2053 `#918 <https://github.com/pybind/pybind11/pull/918>`_.
2054
2055 * Intel C++ compiler compatibility fixes.
2056 `#937 <https://github.com/pybind/pybind11/pull/937>`_.
2057
2058 * Fixed implicit conversion of ``py::enum_`` to integer types on Python 2.7.
2059 `#821 <https://github.com/pybind/pybind11/pull/821>`_.
2060
2061 * Added ``py::hash`` to fetch the hash value of Python objects, and
2062 ``.def(hash(py::self))`` to provide the C++ ``std::hash`` as the Python
2063 ``__hash__`` method.
2064 `#1034 <https://github.com/pybind/pybind11/pull/1034>`_.
2065
2066 * Fixed ``__truediv__`` on Python 2 and ``__itruediv__`` on Python 3.
2067 `#867 <https://github.com/pybind/pybind11/pull/867>`_.
2068
2069 * ``py::capsule`` objects now support the ``name`` attribute. This is useful
2070 for interfacing with ``scipy.LowLevelCallable``.
2071 `#902 <https://github.com/pybind/pybind11/pull/902>`_.
2072
2073 * Fixed ``py::make_iterator``'s ``__next__()`` for past-the-end calls.
2074 `#897 <https://github.com/pybind/pybind11/pull/897>`_.
2075
2076 * Added ``error_already_set::matches()`` for checking Python exceptions.
2077 `#772 <https://github.com/pybind/pybind11/pull/772>`_.
2078
2079 * Deprecated ``py::error_already_set::clear()``. It's no longer needed
2080 following a simplification of the ``py::error_already_set`` class.
2081 `#954 <https://github.com/pybind/pybind11/pull/954>`_.
2082
2083 * Deprecated ``py::handle::operator==()`` in favor of ``py::handle::is()``
2084 `#825 <https://github.com/pybind/pybind11/pull/825>`_.
2085
2086 * Deprecated ``py::object::borrowed``/``py::object::stolen``.
2087 Use ``py::object::borrowed_t{}``/``py::object::stolen_t{}`` instead.
2088 `#771 <https://github.com/pybind/pybind11/pull/771>`_.
2089
2090 * Changed internal data structure versioning to avoid conflicts between
2091 modules compiled with different revisions of pybind11.
2092 `#1012 <https://github.com/pybind/pybind11/pull/1012>`_.
2093
2094 * Additional compile-time and run-time error checking and more informative messages.
2095 `#786 <https://github.com/pybind/pybind11/pull/786>`_,
2096 `#794 <https://github.com/pybind/pybind11/pull/794>`_,
2097 `#803 <https://github.com/pybind/pybind11/pull/803>`_.
2098
2099 * Various minor improvements and fixes.
2100 `#764 <https://github.com/pybind/pybind11/pull/764>`_,
2101 `#791 <https://github.com/pybind/pybind11/pull/791>`_,
2102 `#795 <https://github.com/pybind/pybind11/pull/795>`_,
2103 `#840 <https://github.com/pybind/pybind11/pull/840>`_,
2104 `#844 <https://github.com/pybind/pybind11/pull/844>`_,
2105 `#846 <https://github.com/pybind/pybind11/pull/846>`_,
2106 `#849 <https://github.com/pybind/pybind11/pull/849>`_,
2107 `#858 <https://github.com/pybind/pybind11/pull/858>`_,
2108 `#862 <https://github.com/pybind/pybind11/pull/862>`_,
2109 `#871 <https://github.com/pybind/pybind11/pull/871>`_,
2110 `#872 <https://github.com/pybind/pybind11/pull/872>`_,
2111 `#881 <https://github.com/pybind/pybind11/pull/881>`_,
2112 `#888 <https://github.com/pybind/pybind11/pull/888>`_,
2113 `#899 <https://github.com/pybind/pybind11/pull/899>`_,
2114 `#928 <https://github.com/pybind/pybind11/pull/928>`_,
2115 `#931 <https://github.com/pybind/pybind11/pull/931>`_,
2116 `#944 <https://github.com/pybind/pybind11/pull/944>`_,
2117 `#950 <https://github.com/pybind/pybind11/pull/950>`_,
2118 `#952 <https://github.com/pybind/pybind11/pull/952>`_,
2119 `#962 <https://github.com/pybind/pybind11/pull/962>`_,
2120 `#965 <https://github.com/pybind/pybind11/pull/965>`_,
2121 `#970 <https://github.com/pybind/pybind11/pull/970>`_,
2122 `#978 <https://github.com/pybind/pybind11/pull/978>`_,
2123 `#979 <https://github.com/pybind/pybind11/pull/979>`_,
2124 `#986 <https://github.com/pybind/pybind11/pull/986>`_,
2125 `#1020 <https://github.com/pybind/pybind11/pull/1020>`_,
2126 `#1027 <https://github.com/pybind/pybind11/pull/1027>`_,
2127 `#1037 <https://github.com/pybind/pybind11/pull/1037>`_.
2128
2129 * Testing improvements.
2130 `#798 <https://github.com/pybind/pybind11/pull/798>`_,
2131 `#882 <https://github.com/pybind/pybind11/pull/882>`_,
2132 `#898 <https://github.com/pybind/pybind11/pull/898>`_,
2133 `#900 <https://github.com/pybind/pybind11/pull/900>`_,
2134 `#921 <https://github.com/pybind/pybind11/pull/921>`_,
2135 `#923 <https://github.com/pybind/pybind11/pull/923>`_,
2136 `#963 <https://github.com/pybind/pybind11/pull/963>`_.
2137
2138 v2.1.1 (April 7, 2017)
2139 -----------------------------------------------------
2140
2141 * Fixed minimum version requirement for MSVC 2015u3
2142 `#773 <https://github.com/pybind/pybind11/pull/773>`_.
2143
2144 v2.1.0 (March 22, 2017)
2145 -----------------------------------------------------
2146
2147 * pybind11 now performs function overload resolution in two phases. The first
2148 phase only considers exact type matches, while the second allows for implicit
2149 conversions to take place. A special ``noconvert()`` syntax can be used to
2150 completely disable implicit conversions for specific arguments.
2151 `#643 <https://github.com/pybind/pybind11/pull/643>`_,
2152 `#634 <https://github.com/pybind/pybind11/pull/634>`_,
2153 `#650 <https://github.com/pybind/pybind11/pull/650>`_.
2154
2155 * Fixed a regression where static properties no longer worked with classes
2156 using multiple inheritance. The ``py::metaclass`` attribute is no longer
2157 necessary (and deprecated as of this release) when binding classes with
2158 static properties.
2159 `#679 <https://github.com/pybind/pybind11/pull/679>`_,
2160
2161 * Classes bound using ``pybind11`` can now use custom metaclasses.
2162 `#679 <https://github.com/pybind/pybind11/pull/679>`_,
2163
2164 * ``py::args`` and ``py::kwargs`` can now be mixed with other positional
2165 arguments when binding functions using pybind11.
2166 `#611 <https://github.com/pybind/pybind11/pull/611>`_.
2167
2168 * Improved support for C++11 unicode string and character types; added
2169 extensive documentation regarding pybind11's string conversion behavior.
2170 `#624 <https://github.com/pybind/pybind11/pull/624>`_,
2171 `#636 <https://github.com/pybind/pybind11/pull/636>`_,
2172 `#715 <https://github.com/pybind/pybind11/pull/715>`_.
2173
2174 * pybind11 can now avoid expensive copies when converting Eigen arrays to NumPy
2175 arrays (and vice versa). `#610 <https://github.com/pybind/pybind11/pull/610>`_.
2176
2177 * The "fast path" in ``py::vectorize`` now works for any full-size group of C or
2178 F-contiguous arrays. The non-fast path is also faster since it no longer performs
2179 copies of the input arguments (except when type conversions are necessary).
2180 `#610 <https://github.com/pybind/pybind11/pull/610>`_.
2181
2182 * Added fast, unchecked access to NumPy arrays via a proxy object.
2183 `#746 <https://github.com/pybind/pybind11/pull/746>`_.
2184
2185 * Transparent support for class-specific ``operator new`` and
2186 ``operator delete`` implementations.
2187 `#755 <https://github.com/pybind/pybind11/pull/755>`_.
2188
2189 * Slimmer and more efficient STL-compatible iterator interface for sequence types.
2190 `#662 <https://github.com/pybind/pybind11/pull/662>`_.
2191
2192 * Improved custom holder type support.
2193 `#607 <https://github.com/pybind/pybind11/pull/607>`_.
2194
2195 * ``nullptr`` to ``None`` conversion fixed in various builtin type casters.
2196 `#732 <https://github.com/pybind/pybind11/pull/732>`_.
2197
2198 * ``enum_`` now exposes its members via a special ``__members__`` attribute.
2199 `#666 <https://github.com/pybind/pybind11/pull/666>`_.
2200
2201 * ``std::vector`` bindings created using ``stl_bind.h`` can now optionally
2202 implement the buffer protocol. `#488 <https://github.com/pybind/pybind11/pull/488>`_.
2203
2204 * Automated C++ reference documentation using doxygen and breathe.
2205 `#598 <https://github.com/pybind/pybind11/pull/598>`_.
2206
2207 * Added minimum compiler version assertions.
2208 `#727 <https://github.com/pybind/pybind11/pull/727>`_.
2209
2210 * Improved compatibility with C++1z.
2211 `#677 <https://github.com/pybind/pybind11/pull/677>`_.
2212
2213 * Improved ``py::capsule`` API. Can be used to implement cleanup
2214 callbacks that are involved at module destruction time.
2215 `#752 <https://github.com/pybind/pybind11/pull/752>`_.
2216
2217 * Various minor improvements and fixes.
2218 `#595 <https://github.com/pybind/pybind11/pull/595>`_,
2219 `#588 <https://github.com/pybind/pybind11/pull/588>`_,
2220 `#589 <https://github.com/pybind/pybind11/pull/589>`_,
2221 `#603 <https://github.com/pybind/pybind11/pull/603>`_,
2222 `#619 <https://github.com/pybind/pybind11/pull/619>`_,
2223 `#648 <https://github.com/pybind/pybind11/pull/648>`_,
2224 `#695 <https://github.com/pybind/pybind11/pull/695>`_,
2225 `#720 <https://github.com/pybind/pybind11/pull/720>`_,
2226 `#723 <https://github.com/pybind/pybind11/pull/723>`_,
2227 `#729 <https://github.com/pybind/pybind11/pull/729>`_,
2228 `#724 <https://github.com/pybind/pybind11/pull/724>`_,
2229 `#742 <https://github.com/pybind/pybind11/pull/742>`_,
2230 `#753 <https://github.com/pybind/pybind11/pull/753>`_.
2231
2232 v2.0.1 (Jan 4, 2017)
2233 -----------------------------------------------------
2234
2235 * Fix pointer to reference error in type_caster on MSVC
2236 `#583 <https://github.com/pybind/pybind11/pull/583>`_.
2237
2238 * Fixed a segmentation in the test suite due to a typo
2239 `cd7eac <https://github.com/pybind/pybind11/commit/cd7eac>`_.
2240
2241 v2.0.0 (Jan 1, 2017)
2242 -----------------------------------------------------
2243
2244 * Fixed a reference counting regression affecting types with custom metaclasses
2245 (introduced in v2.0.0-rc1).
2246 `#571 <https://github.com/pybind/pybind11/pull/571>`_.
2247
2248 * Quenched a CMake policy warning.
2249 `#570 <https://github.com/pybind/pybind11/pull/570>`_.
2250
2251 v2.0.0-rc1 (Dec 23, 2016)
2252 -----------------------------------------------------
2253
2254 The pybind11 developers are excited to issue a release candidate of pybind11
2255 with a subsequent v2.0.0 release planned in early January next year.
2256
2257 An incredible amount of effort by went into pybind11 over the last ~5 months,
2258 leading to a release that is jam-packed with exciting new features and numerous
2259 usability improvements. The following list links PRs or individual commits
2260 whenever applicable.
2261
2262 Happy Christmas!
2263
2264 * Support for binding C++ class hierarchies that make use of multiple
2265 inheritance. `#410 <https://github.com/pybind/pybind11/pull/410>`_.
2266
2267 * PyPy support: pybind11 now supports nightly builds of PyPy and will
2268 interoperate with the future 5.7 release. No code changes are necessary,
2269 everything "just" works as usual. Note that we only target the Python 2.7
2270 branch for now; support for 3.x will be added once its ``cpyext`` extension
2271 support catches up. A few minor features remain unsupported for the time
2272 being (notably dynamic attributes in custom types).
2273 `#527 <https://github.com/pybind/pybind11/pull/527>`_.
2274
2275 * Significant work on the documentation -- in particular, the monolithic
2276 ``advanced.rst`` file was restructured into a easier to read hierarchical
2277 organization. `#448 <https://github.com/pybind/pybind11/pull/448>`_.
2278
2279 * Many NumPy-related improvements:
2280
2281 1. Object-oriented API to access and modify NumPy ``ndarray`` instances,
2282 replicating much of the corresponding NumPy C API functionality.
2283 `#402 <https://github.com/pybind/pybind11/pull/402>`_.
2284
2285 2. NumPy array ``dtype`` array descriptors are now first-class citizens and
2286 are exposed via a new class ``py::dtype``.
2287
2288 3. Structured dtypes can be registered using the ``PYBIND11_NUMPY_DTYPE()``
2289 macro. Special ``array`` constructors accepting dtype objects were also
2290 added.
2291
2292 One potential caveat involving this change: format descriptor strings
2293 should now be accessed via ``format_descriptor::format()`` (however, for
2294 compatibility purposes, the old syntax ``format_descriptor::value`` will
2295 still work for non-structured data types). `#308
2296 <https://github.com/pybind/pybind11/pull/308>`_.
2297
2298 4. Further improvements to support structured dtypes throughout the system.
2299 `#472 <https://github.com/pybind/pybind11/pull/472>`_,
2300 `#474 <https://github.com/pybind/pybind11/pull/474>`_,
2301 `#459 <https://github.com/pybind/pybind11/pull/459>`_,
2302 `#453 <https://github.com/pybind/pybind11/pull/453>`_,
2303 `#452 <https://github.com/pybind/pybind11/pull/452>`_, and
2304 `#505 <https://github.com/pybind/pybind11/pull/505>`_.
2305
2306 5. Fast access operators. `#497 <https://github.com/pybind/pybind11/pull/497>`_.
2307
2308 6. Constructors for arrays whose storage is owned by another object.
2309 `#440 <https://github.com/pybind/pybind11/pull/440>`_.
2310
2311 7. Added constructors for ``array`` and ``array_t`` explicitly accepting shape
2312 and strides; if strides are not provided, they are deduced assuming
2313 C-contiguity. Also added simplified constructors for 1-dimensional case.
2314
2315 8. Added buffer/NumPy support for ``char[N]`` and ``std::array<char, N>`` types.
2316
2317 9. Added ``memoryview`` wrapper type which is constructible from ``buffer_info``.
2318
2319 * Eigen: many additional conversions and support for non-contiguous
2320 arrays/slices.
2321 `#427 <https://github.com/pybind/pybind11/pull/427>`_,
2322 `#315 <https://github.com/pybind/pybind11/pull/315>`_,
2323 `#316 <https://github.com/pybind/pybind11/pull/316>`_,
2324 `#312 <https://github.com/pybind/pybind11/pull/312>`_, and
2325 `#267 <https://github.com/pybind/pybind11/pull/267>`_
2326
2327 * Incompatible changes in ``class_<...>::class_()``:
2328
2329 1. Declarations of types that provide access via the buffer protocol must
2330 now include the ``py::buffer_protocol()`` annotation as an argument to
2331 the ``class_`` constructor.
2332
2333 2. Declarations of types that require a custom metaclass (i.e. all classes
2334 which include static properties via commands such as
2335 ``def_readwrite_static()``) must now include the ``py::metaclass()``
2336 annotation as an argument to the ``class_`` constructor.
2337
2338 These two changes were necessary to make type definitions in pybind11
2339 future-proof, and to support PyPy via its cpyext mechanism. `#527
2340 <https://github.com/pybind/pybind11/pull/527>`_.
2341
2342
2343 3. This version of pybind11 uses a redesigned mechanism for instantiating
2344 trampoline classes that are used to override virtual methods from within
2345 Python. This led to the following user-visible syntax change: instead of
2346
2347 .. code-block:: cpp
2348
2349 py::class_<TrampolineClass>("MyClass")
2350 .alias<MyClass>()
2351 ....
2352
2353 write
2354
2355 .. code-block:: cpp
2356
2357 py::class_<MyClass, TrampolineClass>("MyClass")
2358 ....
2359
2360 Importantly, both the original and the trampoline class are now
2361 specified as an arguments (in arbitrary order) to the ``py::class_``
2362 template, and the ``alias<..>()`` call is gone. The new scheme has zero
2363 overhead in cases when Python doesn't override any functions of the
2364 underlying C++ class. `rev. 86d825
2365 <https://github.com/pybind/pybind11/commit/86d825>`_.
2366
2367 * Added ``eval`` and ``eval_file`` functions for evaluating expressions and
2368 statements from a string or file. `rev. 0d3fc3
2369 <https://github.com/pybind/pybind11/commit/0d3fc3>`_.
2370
2371 * pybind11 can now create types with a modifiable dictionary.
2372 `#437 <https://github.com/pybind/pybind11/pull/437>`_ and
2373 `#444 <https://github.com/pybind/pybind11/pull/444>`_.
2374
2375 * Support for translation of arbitrary C++ exceptions to Python counterparts.
2376 `#296 <https://github.com/pybind/pybind11/pull/296>`_ and
2377 `#273 <https://github.com/pybind/pybind11/pull/273>`_.
2378
2379 * Report full backtraces through mixed C++/Python code, better reporting for
2380 import errors, fixed GIL management in exception processing.
2381 `#537 <https://github.com/pybind/pybind11/pull/537>`_,
2382 `#494 <https://github.com/pybind/pybind11/pull/494>`_,
2383 `rev. e72d95 <https://github.com/pybind/pybind11/commit/e72d95>`_, and
2384 `rev. 099d6e <https://github.com/pybind/pybind11/commit/099d6e>`_.
2385
2386 * Support for bit-level operations, comparisons, and serialization of C++
2387 enumerations. `#503 <https://github.com/pybind/pybind11/pull/503>`_,
2388 `#508 <https://github.com/pybind/pybind11/pull/508>`_,
2389 `#380 <https://github.com/pybind/pybind11/pull/380>`_,
2390 `#309 <https://github.com/pybind/pybind11/pull/309>`_.
2391 `#311 <https://github.com/pybind/pybind11/pull/311>`_.
2392
2393 * The ``class_`` constructor now accepts its template arguments in any order.
2394 `#385 <https://github.com/pybind/pybind11/pull/385>`_.
2395
2396 * Attribute and item accessors now have a more complete interface which makes
2397 it possible to chain attributes as in
2398 ``obj.attr("a")[key].attr("b").attr("method")(1, 2, 3)``. `#425
2399 <https://github.com/pybind/pybind11/pull/425>`_.
2400
2401 * Major redesign of the default and conversion constructors in ``pytypes.h``.
2402 `#464 <https://github.com/pybind/pybind11/pull/464>`_.
2403
2404 * Added built-in support for ``std::shared_ptr`` holder type. It is no longer
2405 necessary to to include a declaration of the form
2406 ``PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`` (though continuing to
2407 do so won't cause an error).
2408 `#454 <https://github.com/pybind/pybind11/pull/454>`_.
2409
2410 * New ``py::overload_cast`` casting operator to select among multiple possible
2411 overloads of a function. An example:
2412
2413 .. code-block:: cpp
2414
2415 py::class_<Pet>(m, "Pet")
2416 .def("set", py::overload_cast<int>(&Pet::set), "Set the pet's age")
2417 .def("set", py::overload_cast<const std::string &>(&Pet::set), "Set the pet's name");
2418
2419 This feature only works on C++14-capable compilers.
2420 `#541 <https://github.com/pybind/pybind11/pull/541>`_.
2421
2422 * C++ types are automatically cast to Python types, e.g. when assigning
2423 them as an attribute. For instance, the following is now legal:
2424
2425 .. code-block:: cpp
2426
2427 py::module m = /* ... */
2428 m.attr("constant") = 123;
2429
2430 (Previously, a ``py::cast`` call was necessary to avoid a compilation error.)
2431 `#551 <https://github.com/pybind/pybind11/pull/551>`_.
2432
2433 * Redesigned ``pytest``-based test suite. `#321 <https://github.com/pybind/pybind11/pull/321>`_.
2434
2435 * Instance tracking to detect reference leaks in test suite. `#324 <https://github.com/pybind/pybind11/pull/324>`_
2436
2437 * pybind11 can now distinguish between multiple different instances that are
2438 located at the same memory address, but which have different types.
2439 `#329 <https://github.com/pybind/pybind11/pull/329>`_.
2440
2441 * Improved logic in ``move`` return value policy.
2442 `#510 <https://github.com/pybind/pybind11/pull/510>`_,
2443 `#297 <https://github.com/pybind/pybind11/pull/297>`_.
2444
2445 * Generalized unpacking API to permit calling Python functions from C++ using
2446 notation such as ``foo(a1, a2, *args, "ka"_a=1, "kb"_a=2, **kwargs)``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
2447
2448 * ``py::print()`` function whose behavior matches that of the native Python
2449 ``print()`` function. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
2450
2451 * Added ``py::dict`` keyword constructor:``auto d = dict("number"_a=42,
2452 "name"_a="World");``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
2453
2454 * Added ``py::str::format()`` method and ``_s`` literal: ``py::str s = "1 + 2
2455 = {}"_s.format(3);``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
2456
2457 * Added ``py::repr()`` function which is equivalent to Python's builtin
2458 ``repr()``. `#333 <https://github.com/pybind/pybind11/pull/333>`_.
2459
2460 * Improved construction and destruction logic for holder types. It is now
2461 possible to reference instances with smart pointer holder types without
2462 constructing the holder if desired. The ``PYBIND11_DECLARE_HOLDER_TYPE``
2463 macro now accepts an optional second parameter to indicate whether the holder
2464 type uses intrusive reference counting.
2465 `#533 <https://github.com/pybind/pybind11/pull/533>`_ and
2466 `#561 <https://github.com/pybind/pybind11/pull/561>`_.
2467
2468 * Mapping a stateless C++ function to Python and back is now "for free" (i.e.
2469 no extra indirections or argument conversion overheads). `rev. 954b79
2470 <https://github.com/pybind/pybind11/commit/954b79>`_.
2471
2472 * Bindings for ``std::valarray<T>``.
2473 `#545 <https://github.com/pybind/pybind11/pull/545>`_.
2474
2475 * Improved support for C++17 capable compilers.
2476 `#562 <https://github.com/pybind/pybind11/pull/562>`_.
2477
2478 * Bindings for ``std::optional<t>``.
2479 `#475 <https://github.com/pybind/pybind11/pull/475>`_,
2480 `#476 <https://github.com/pybind/pybind11/pull/476>`_,
2481 `#479 <https://github.com/pybind/pybind11/pull/479>`_,
2482 `#499 <https://github.com/pybind/pybind11/pull/499>`_, and
2483 `#501 <https://github.com/pybind/pybind11/pull/501>`_.
2484
2485 * ``stl_bind.h``: general improvements and support for ``std::map`` and
2486 ``std::unordered_map``.
2487 `#490 <https://github.com/pybind/pybind11/pull/490>`_,
2488 `#282 <https://github.com/pybind/pybind11/pull/282>`_,
2489 `#235 <https://github.com/pybind/pybind11/pull/235>`_.
2490
2491 * The ``std::tuple``, ``std::pair``, ``std::list``, and ``std::vector`` type
2492 casters now accept any Python sequence type as input. `rev. 107285
2493 <https://github.com/pybind/pybind11/commit/107285>`_.
2494
2495 * Improved CMake Python detection on multi-architecture Linux.
2496 `#532 <https://github.com/pybind/pybind11/pull/532>`_.
2497
2498 * Infrastructure to selectively disable or enable parts of the automatically
2499 generated docstrings. `#486 <https://github.com/pybind/pybind11/pull/486>`_.
2500
2501 * ``reference`` and ``reference_internal`` are now the default return value
2502 properties for static and non-static properties, respectively. `#473
2503 <https://github.com/pybind/pybind11/pull/473>`_. (the previous defaults
2504 were ``automatic``). `#473 <https://github.com/pybind/pybind11/pull/473>`_.
2505
2506 * Support for ``std::unique_ptr`` with non-default deleters or no deleter at
2507 all (``py::nodelete``). `#384 <https://github.com/pybind/pybind11/pull/384>`_.
2508
2509 * Deprecated ``handle::call()`` method. The new syntax to call Python
2510 functions is simply ``handle()``. It can also be invoked explicitly via
2511 ``handle::operator<X>()``, where ``X`` is an optional return value policy.
2512
2513 * Print more informative error messages when ``make_tuple()`` or ``cast()``
2514 fail. `#262 <https://github.com/pybind/pybind11/pull/262>`_.
2515
2516 * Creation of holder types for classes deriving from
2517 ``std::enable_shared_from_this<>`` now also works for ``const`` values.
2518 `#260 <https://github.com/pybind/pybind11/pull/260>`_.
2519
2520 * ``make_iterator()`` improvements for better compatibility with various
2521 types (now uses prefix increment operator); it now also accepts iterators
2522 with different begin/end types as long as they are equality comparable.
2523 `#247 <https://github.com/pybind/pybind11/pull/247>`_.
2524
2525 * ``arg()`` now accepts a wider range of argument types for default values.
2526 `#244 <https://github.com/pybind/pybind11/pull/244>`_.
2527
2528 * Support ``keep_alive`` where the nurse object may be ``None``. `#341
2529 <https://github.com/pybind/pybind11/pull/341>`_.
2530
2531 * Added constructors for ``str`` and ``bytes`` from zero-terminated char
2532 pointers, and from char pointers and length. Added constructors for ``str``
2533 from ``bytes`` and for ``bytes`` from ``str``, which will perform UTF-8
2534 decoding/encoding as required.
2535
2536 * Many other improvements of library internals without user-visible changes
2537
2538
2539 1.8.1 (July 12, 2016)
2540 ----------------------
2541 * Fixed a rare but potentially very severe issue when the garbage collector ran
2542 during pybind11 type creation.
2543
2544 1.8.0 (June 14, 2016)
2545 ----------------------
2546 * Redesigned CMake build system which exports a convenient
2547 ``pybind11_add_module`` function to parent projects.
2548 * ``std::vector<>`` type bindings analogous to Boost.Python's ``indexing_suite``
2549 * Transparent conversion of sparse and dense Eigen matrices and vectors (``eigen.h``)
2550 * Added an ``ExtraFlags`` template argument to the NumPy ``array_t<>`` wrapper
2551 to disable an enforced cast that may lose precision, e.g. to create overloads
2552 for different precisions and complex vs real-valued matrices.
2553 * Prevent implicit conversion of floating point values to integral types in
2554 function arguments
2555 * Fixed incorrect default return value policy for functions returning a shared
2556 pointer
2557 * Don't allow registering a type via ``class_`` twice
2558 * Don't allow casting a ``None`` value into a C++ lvalue reference
2559 * Fixed a crash in ``enum_::operator==`` that was triggered by the ``help()`` command
2560 * Improved detection of whether or not custom C++ types can be copy/move-constructed
2561 * Extended ``str`` type to also work with ``bytes`` instances
2562 * Added a ``"name"_a`` user defined string literal that is equivalent to ``py::arg("name")``.
2563 * When specifying function arguments via ``py::arg``, the test that verifies
2564 the number of arguments now runs at compile time.
2565 * Added ``[[noreturn]]`` attribute to ``pybind11_fail()`` to quench some
2566 compiler warnings
2567 * List function arguments in exception text when the dispatch code cannot find
2568 a matching overload
2569 * Added ``PYBIND11_OVERLOAD_NAME`` and ``PYBIND11_OVERLOAD_PURE_NAME`` macros which
2570 can be used to override virtual methods whose name differs in C++ and Python
2571 (e.g. ``__call__`` and ``operator()``)
2572 * Various minor ``iterator`` and ``make_iterator()`` improvements
2573 * Transparently support ``__bool__`` on Python 2.x and Python 3.x
2574 * Fixed issue with destructor of unpickled object not being called
2575 * Minor CMake build system improvements on Windows
2576 * New ``pybind11::args`` and ``pybind11::kwargs`` types to create functions which
2577 take an arbitrary number of arguments and keyword arguments
2578 * New syntax to call a Python function from C++ using ``*args`` and ``*kwargs``
2579 * The functions ``def_property_*`` now correctly process docstring arguments (these
2580 formerly caused a segmentation fault)
2581 * Many ``mkdoc.py`` improvements (enumerations, template arguments, ``DOC()``
2582 macro accepts more arguments)
2583 * Cygwin support
2584 * Documentation improvements (pickling support, ``keep_alive``, macro usage)
2585
2586 1.7 (April 30, 2016)
2587 ----------------------
2588 * Added a new ``move`` return value policy that triggers C++11 move semantics.
2589 The automatic return value policy falls back to this case whenever a rvalue
2590 reference is encountered
2591 * Significantly more general GIL state routines that are used instead of
2592 Python's troublesome ``PyGILState_Ensure`` and ``PyGILState_Release`` API
2593 * Redesign of opaque types that drastically simplifies their usage
2594 * Extended ability to pass values of type ``[const] void *``
2595 * ``keep_alive`` fix: don't fail when there is no patient
2596 * ``functional.h``: acquire the GIL before calling a Python function
2597 * Added Python RAII type wrappers ``none`` and ``iterable``
2598 * Added ``*args`` and ``*kwargs`` pass-through parameters to
2599 ``pybind11.get_include()`` function
2600 * Iterator improvements and fixes
2601 * Documentation on return value policies and opaque types improved
2602
2603 1.6 (April 30, 2016)
2604 ----------------------
2605 * Skipped due to upload to PyPI gone wrong and inability to recover
2606 (https://github.com/pypa/packaging-problems/issues/74)
2607
2608 1.5 (April 21, 2016)
2609 ----------------------
2610 * For polymorphic types, use RTTI to try to return the closest type registered with pybind11
2611 * Pickling support for serializing and unserializing C++ instances to a byte stream in Python
2612 * Added a convenience routine ``make_iterator()`` which turns a range indicated
2613 by a pair of C++ iterators into a iterable Python object
2614 * Added ``len()`` and a variadic ``make_tuple()`` function
2615 * Addressed a rare issue that could confuse the current virtual function
2616 dispatcher and another that could lead to crashes in multi-threaded
2617 applications
2618 * Added a ``get_include()`` function to the Python module that returns the path
2619 of the directory containing the installed pybind11 header files
2620 * Documentation improvements: import issues, symbol visibility, pickling, limitations
2621 * Added casting support for ``std::reference_wrapper<>``
2622
2623 1.4 (April 7, 2016)
2624 --------------------------
2625 * Transparent type conversion for ``std::wstring`` and ``wchar_t``
2626 * Allow passing ``nullptr``-valued strings
2627 * Transparent passing of ``void *`` pointers using capsules
2628 * Transparent support for returning values wrapped in ``std::unique_ptr<>``
2629 * Improved docstring generation for compatibility with Sphinx
2630 * Nicer debug error message when default parameter construction fails
2631 * Support for "opaque" types that bypass the transparent conversion layer for STL containers
2632 * Redesigned type casting interface to avoid ambiguities that could occasionally cause compiler errors
2633 * Redesigned property implementation; fixes crashes due to an unfortunate default return value policy
2634 * Anaconda package generation support
2635
2636 1.3 (March 8, 2016)
2637 --------------------------
2638
2639 * Added support for the Intel C++ compiler (v15+)
2640 * Added support for the STL unordered set/map data structures
2641 * Added support for the STL linked list data structure
2642 * NumPy-style broadcasting support in ``pybind11::vectorize``
2643 * pybind11 now displays more verbose error messages when ``arg::operator=()`` fails
2644 * pybind11 internal data structures now live in a version-dependent namespace to avoid ABI issues
2645 * Many, many bugfixes involving corner cases and advanced usage
2646
2647 1.2 (February 7, 2016)
2648 --------------------------
2649
2650 * Optional: efficient generation of function signatures at compile time using C++14
2651 * Switched to a simpler and more general way of dealing with function default
2652 arguments. Unused keyword arguments in function calls are now detected and
2653 cause errors as expected
2654 * New ``keep_alive`` call policy analogous to Boost.Python's ``with_custodian_and_ward``
2655 * New ``pybind11::base<>`` attribute to indicate a subclass relationship
2656 * Improved interface for RAII type wrappers in ``pytypes.h``
2657 * Use RAII type wrappers consistently within pybind11 itself. This
2658 fixes various potential refcount leaks when exceptions occur
2659 * Added new ``bytes`` RAII type wrapper (maps to ``string`` in Python 2.7)
2660 * Made handle and related RAII classes const correct, using them more
2661 consistently everywhere now
2662 * Got rid of the ugly ``__pybind11__`` attributes on the Python side---they are
2663 now stored in a C++ hash table that is not visible in Python
2664 * Fixed refcount leaks involving NumPy arrays and bound functions
2665 * Vastly improved handling of shared/smart pointers
2666 * Removed an unnecessary copy operation in ``pybind11::vectorize``
2667 * Fixed naming clashes when both pybind11 and NumPy headers are included
2668 * Added conversions for additional exception types
2669 * Documentation improvements (using multiple extension modules, smart pointers,
2670 other minor clarifications)
2671 * unified infrastructure for parsing variadic arguments in ``class_`` and cpp_function
2672 * Fixed license text (was: ZLIB, should have been: 3-clause BSD)
2673 * Python 3.2 compatibility
2674 * Fixed remaining issues when accessing types in another plugin module
2675 * Added enum comparison and casting methods
2676 * Improved SFINAE-based detection of whether types are copy-constructible
2677 * Eliminated many warnings about unused variables and the use of ``offsetof()``
2678 * Support for ``std::array<>`` conversions
2679
2680 1.1 (December 7, 2015)
2681 --------------------------
2682
2683 * Documentation improvements (GIL, wrapping functions, casting, fixed many typos)
2684 * Generalized conversion of integer types
2685 * Improved support for casting function objects
2686 * Improved support for ``std::shared_ptr<>`` conversions
2687 * Initial support for ``std::set<>`` conversions
2688 * Fixed type resolution issue for types defined in a separate plugin module
2689 * CMake build system improvements
2690 * Factored out generic functionality to non-templated code (smaller code size)
2691 * Added a code size / compile time benchmark vs Boost.Python
2692 * Added an appveyor CI script
2693
2694 1.0 (October 15, 2015)
2695 ------------------------
2696 * Initial release