1.. _changelog: 2 3Changelog 4######### 5 6Starting with version 1.8.0, pybind11 releases use a `semantic versioning 7<http://semver.org>`_ policy. 8 9 10v2.6.2 (Jan 26, 2021) 11--------------------- 12 13Minor missing functionality added: 14 15* enum: add missing Enum.value property. 16 `#2739 <https://github.com/pybind/pybind11/pull/2739>`_ 17 18* Allow thread termination to be avoided during shutdown for CPython 3.7+ via 19 ``.disarm`` for ``gil_scoped_acquire``/``gil_scoped_release``. 20 `#2657 <https://github.com/pybind/pybind11/pull/2657>`_ 21 22Fixed or improved behavior in a few special cases: 23 24* Fix bug where the constructor of ``object`` subclasses would not throw on 25 being passed a Python object of the wrong type. 26 `#2701 <https://github.com/pybind/pybind11/pull/2701>`_ 27 28* The ``type_caster`` for integers does not convert Python objects with 29 ``__int__`` anymore with ``noconvert`` or during the first round of trying 30 overloads. 31 `#2698 <https://github.com/pybind/pybind11/pull/2698>`_ 32 33* When casting to a C++ integer, ``__index__`` is always called and not 34 considered as conversion, consistent with Python 3.8+. 35 `#2801 <https://github.com/pybind/pybind11/pull/2801>`_ 36 37Build improvements: 38 39* Setup helpers: ``extra_compile_args`` and ``extra_link_args`` automatically set by 40 Pybind11Extension are now prepended, which allows them to be overridden 41 by user-set ``extra_compile_args`` and ``extra_link_args``. 42 `#2808 <https://github.com/pybind/pybind11/pull/2808>`_ 43 44* Setup helpers: Don't trigger unused parameter warning. 45 `#2735 <https://github.com/pybind/pybind11/pull/2735>`_ 46 47* CMake: Support running with ``--warn-uninitialized`` active. 48 `#2806 <https://github.com/pybind/pybind11/pull/2806>`_ 49 50* CMake: Avoid error if included from two submodule directories. 51 `#2804 <https://github.com/pybind/pybind11/pull/2804>`_ 52 53* CMake: Fix ``STATIC`` / ``SHARED`` being ignored in FindPython mode. 54 `#2796 <https://github.com/pybind/pybind11/pull/2796>`_ 55 56* CMake: Respect the setting for ``CMAKE_CXX_VISIBILITY_PRESET`` if defined. 57 `#2793 <https://github.com/pybind/pybind11/pull/2793>`_ 58 59* CMake: Fix issue with FindPython2/FindPython3 not working with ``pybind11::embed``. 60 `#2662 <https://github.com/pybind/pybind11/pull/2662>`_ 61 62* CMake: mixing local and installed pybind11's would prioritize the installed 63 one over the local one (regression in 2.6.0). 64 `#2716 <https://github.com/pybind/pybind11/pull/2716>`_ 65 66 67Bug fixes: 68 69* Fixed segfault in multithreaded environments when using 70 ``scoped_ostream_redirect``. 71 `#2675 <https://github.com/pybind/pybind11/pull/2675>`_ 72 73* Leave docstring unset when all docstring-related options are disabled, rather 74 than set an empty string. 75 `#2745 <https://github.com/pybind/pybind11/pull/2745>`_ 76 77* The module key in builtins that pybind11 uses to store its internals changed 78 from std::string to a python str type (more natural on Python 2, no change on 79 Python 3). 80 `#2814 <https://github.com/pybind/pybind11/pull/2814>`_ 81 82* Fixed assertion error related to unhandled (later overwritten) exception in 83 CPython 3.8 and 3.9 debug builds. 84 `#2685 <https://github.com/pybind/pybind11/pull/2685>`_ 85 86* Fix ``py::gil_scoped_acquire`` assert with CPython 3.9 debug build. 87 `#2683 <https://github.com/pybind/pybind11/pull/2683>`_ 88 89* Fix issue with a test failing on PyTest 6.2. 90 `#2741 <https://github.com/pybind/pybind11/pull/2741>`_ 91 92Warning fixes: 93 94* Fix warning modifying constructor parameter 'flag' that shadows a field of 95 'set_flag' ``[-Wshadow-field-in-constructor-modified]``. 96 `#2780 <https://github.com/pybind/pybind11/pull/2780>`_ 97 98* Suppressed some deprecation warnings about old-style 99 ``__init__``/``__setstate__`` in the tests. 100 `#2759 <https://github.com/pybind/pybind11/pull/2759>`_ 101 102Valgrind work: 103 104* Fix invalid access when calling a pybind11 ``__init__`` on a non-pybind11 105 class instance. 106 `#2755 <https://github.com/pybind/pybind11/pull/2755>`_ 107 108* Fixed various minor memory leaks in pybind11's test suite. 109 `#2758 <https://github.com/pybind/pybind11/pull/2758>`_ 110 111* Resolved memory leak in cpp_function initialization when exceptions occurred. 112 `#2756 <https://github.com/pybind/pybind11/pull/2756>`_ 113 114* Added a Valgrind build, checking for leaks and memory-related UB, to CI. 115 `#2746 <https://github.com/pybind/pybind11/pull/2746>`_ 116 117Compiler support: 118 119* Intel compiler was not activating C++14 support due to a broken define. 120 `#2679 <https://github.com/pybind/pybind11/pull/2679>`_ 121 122* Support ICC and NVIDIA HPC SDK in C++17 mode. 123 `#2729 <https://github.com/pybind/pybind11/pull/2729>`_ 124 125* Support Intel OneAPI compiler (ICC 20.2) and add to CI. 126 `#2573 <https://github.com/pybind/pybind11/pull/2573>`_ 127 128 129 130v2.6.1 (Nov 11, 2020) 131--------------------- 132 133* ``py::exec``, ``py::eval``, and ``py::eval_file`` now add the builtins module 134 as ``"__builtins__"`` to their ``globals`` argument, better matching ``exec`` 135 and ``eval`` in pure Python. 136 `#2616 <https://github.com/pybind/pybind11/pull/2616>`_ 137 138* ``setup_helpers`` will no longer set a minimum macOS version higher than the 139 current version. 140 `#2622 <https://github.com/pybind/pybind11/pull/2622>`_ 141 142* Allow deleting static properties. 143 `#2629 <https://github.com/pybind/pybind11/pull/2629>`_ 144 145* Seal a leak in ``def_buffer``, cleaning up the ``capture`` object after the 146 ``class_`` object goes out of scope. 147 `#2634 <https://github.com/pybind/pybind11/pull/2634>`_ 148 149* ``pybind11_INCLUDE_DIRS`` was incorrect, potentially causing a regression if 150 it was expected to include ``PYTHON_INCLUDE_DIRS`` (please use targets 151 instead). 152 `#2636 <https://github.com/pybind/pybind11/pull/2636>`_ 153 154* Added parameter names to the ``py::enum_`` constructor and methods, avoiding 155 ``arg0`` in the generated docstrings. 156 `#2637 <https://github.com/pybind/pybind11/pull/2637>`_ 157 158* Added ``needs_recompile`` optional function to the ``ParallelCompiler`` 159 helper, to allow a recompile to be skipped based on a user-defined function. 160 `#2643 <https://github.com/pybind/pybind11/pull/2643>`_ 161 162 163v2.6.0 (Oct 21, 2020) 164--------------------- 165 166See :ref:`upgrade-guide-2.6` for help upgrading to the new version. 167 168New features: 169 170* Keyword-only arguments supported in Python 2 or 3 with ``py::kw_only()``. 171 `#2100 <https://github.com/pybind/pybind11/pull/2100>`_ 172 173* Positional-only arguments supported in Python 2 or 3 with ``py::pos_only()``. 174 `#2459 <https://github.com/pybind/pybind11/pull/2459>`_ 175 176* ``py::is_final()`` class modifier to block subclassing (CPython only). 177 `#2151 <https://github.com/pybind/pybind11/pull/2151>`_ 178 179* Added ``py::prepend()``, allowing a function to be placed at the beginning of 180 the overload chain. 181 `#1131 <https://github.com/pybind/pybind11/pull/1131>`_ 182 183* Access to the type object now provided with ``py::type::of<T>()`` and 184 ``py::type::of(h)``. 185 `#2364 <https://github.com/pybind/pybind11/pull/2364>`_ 186 187* Perfect forwarding support for methods. 188 `#2048 <https://github.com/pybind/pybind11/pull/2048>`_ 189 190* Added ``py::error_already_set::discard_as_unraisable()``. 191 `#2372 <https://github.com/pybind/pybind11/pull/2372>`_ 192 193* ``py::hash`` is now public. 194 `#2217 <https://github.com/pybind/pybind11/pull/2217>`_ 195 196* ``py::class_<union_type>`` is now supported. Note that writing to one data 197 member of the union and reading another (type punning) is UB in C++. Thus 198 pybind11-bound enums should never be used for such conversions. 199 `#2320 <https://github.com/pybind/pybind11/pull/2320>`_. 200 201* Classes now check local scope when registering members, allowing a subclass 202 to have a member with the same name as a parent (such as an enum). 203 `#2335 <https://github.com/pybind/pybind11/pull/2335>`_ 204 205Code correctness features: 206 207* Error now thrown when ``__init__`` is forgotten on subclasses. 208 `#2152 <https://github.com/pybind/pybind11/pull/2152>`_ 209 210* Throw error if conversion to a pybind11 type if the Python object isn't a 211 valid instance of that type, such as ``py::bytes(o)`` when ``py::object o`` 212 isn't a bytes instance. 213 `#2349 <https://github.com/pybind/pybind11/pull/2349>`_ 214 215* Throw if conversion to ``str`` fails. 216 `#2477 <https://github.com/pybind/pybind11/pull/2477>`_ 217 218 219API changes: 220 221* ``py::module`` was renamed ``py::module_`` to avoid issues with C++20 when 222 used unqualified, but an alias ``py::module`` is provided for backward 223 compatibility. 224 `#2489 <https://github.com/pybind/pybind11/pull/2489>`_ 225 226* Public constructors for ``py::module_`` have been deprecated; please use 227 ``pybind11::module_::create_extension_module`` if you were using the public 228 constructor (fairly rare after ``PYBIND11_MODULE`` was introduced). 229 `#2552 <https://github.com/pybind/pybind11/pull/2552>`_ 230 231* ``PYBIND11_OVERLOAD*`` macros and ``get_overload`` function replaced by 232 correctly-named ``PYBIND11_OVERRIDE*`` and ``get_override``, fixing 233 inconsistencies in the presence of a closing ``;`` in these macros. 234 ``get_type_overload`` is deprecated. 235 `#2325 <https://github.com/pybind/pybind11/pull/2325>`_ 236 237Packaging / building improvements: 238 239* The Python package was reworked to be more powerful and useful. 240 `#2433 <https://github.com/pybind/pybind11/pull/2433>`_ 241 242 * :ref:`build-setuptools` is easier thanks to a new 243 ``pybind11.setup_helpers`` module, which provides utilities to use 244 setuptools with pybind11. It can be used via PEP 518, ``setup_requires``, 245 or by directly importing or copying ``setup_helpers.py`` into your project. 246 247 * CMake configuration files are now included in the Python package. Use 248 ``pybind11.get_cmake_dir()`` or ``python -m pybind11 --cmakedir`` to get 249 the directory with the CMake configuration files, or include the 250 site-packages location in your ``CMAKE_MODULE_PATH``. Or you can use the 251 new ``pybind11[global]`` extra when you install ``pybind11``, which 252 installs the CMake files and headers into your base environment in the 253 standard location. 254 255 * ``pybind11-config`` is another way to write ``python -m pybind11`` if you 256 have your PATH set up. 257 258 * Added external typing support to the helper module, code from 259 ``import pybind11`` can now be type checked. 260 `#2588 <https://github.com/pybind/pybind11/pull/2588>`_ 261 262* Minimum CMake required increased to 3.4. 263 `#2338 <https://github.com/pybind/pybind11/pull/2338>`_ and 264 `#2370 <https://github.com/pybind/pybind11/pull/2370>`_ 265 266 * Full integration with CMake’s C++ standard system and compile features 267 replaces ``PYBIND11_CPP_STANDARD``. 268 269 * Generated config file is now portable to different Python/compiler/CMake 270 versions. 271 272 * Virtual environments prioritized if ``PYTHON_EXECUTABLE`` is not set 273 (``venv``, ``virtualenv``, and ``conda``) (similar to the new FindPython 274 mode). 275 276 * Other CMake features now natively supported, like 277 ``CMAKE_INTERPROCEDURAL_OPTIMIZATION``, ``set(CMAKE_CXX_VISIBILITY_PRESET 278 hidden)``. 279 280 * ``CUDA`` as a language is now supported. 281 282 * Helper functions ``pybind11_strip``, ``pybind11_extension``, 283 ``pybind11_find_import`` added, see :doc:`cmake/index`. 284 285 * Optional :ref:`find-python-mode` and :ref:`nopython-mode` with CMake. 286 `#2370 <https://github.com/pybind/pybind11/pull/2370>`_ 287 288* Uninstall target added. 289 `#2265 <https://github.com/pybind/pybind11/pull/2265>`_ and 290 `#2346 <https://github.com/pybind/pybind11/pull/2346>`_ 291 292* ``pybind11_add_module()`` now accepts an optional ``OPT_SIZE`` flag that 293 switches the binding target to size-based optimization if the global build 294 type can not always be fixed to ``MinSizeRel`` (except in debug mode, where 295 optimizations remain disabled). ``MinSizeRel`` or this flag reduces binary 296 size quite substantially (~25% on some platforms). 297 `#2463 <https://github.com/pybind/pybind11/pull/2463>`_ 298 299Smaller or developer focused features and fixes: 300 301* Moved ``mkdoc.py`` to a new repo, `pybind11-mkdoc`_. There are no longer 302 submodules in the main repo. 303 304* ``py::memoryview`` segfault fix and update, with new 305 ``py::memoryview::from_memory`` in Python 3, and documentation. 306 `#2223 <https://github.com/pybind/pybind11/pull/2223>`_ 307 308* Fix for ``buffer_info`` on Python 2. 309 `#2503 <https://github.com/pybind/pybind11/pull/2503>`_ 310 311* If ``__eq__`` defined but not ``__hash__``, ``__hash__`` is now set to 312 ``None``. 313 `#2291 <https://github.com/pybind/pybind11/pull/2291>`_ 314 315* ``py::ellipsis`` now also works on Python 2. 316 `#2360 <https://github.com/pybind/pybind11/pull/2360>`_ 317 318* Pointer to ``std::tuple`` & ``std::pair`` supported in cast. 319 `#2334 <https://github.com/pybind/pybind11/pull/2334>`_ 320 321* Small fixes in NumPy support. ``py::array`` now uses ``py::ssize_t`` as first 322 argument type. 323 `#2293 <https://github.com/pybind/pybind11/pull/2293>`_ 324 325* Added missing signature for ``py::array``. 326 `#2363 <https://github.com/pybind/pybind11/pull/2363>`_ 327 328* ``unchecked_mutable_reference`` has access to operator ``()`` and ``[]`` when 329 const. 330 `#2514 <https://github.com/pybind/pybind11/pull/2514>`_ 331 332* ``py::vectorize`` is now supported on functions that return void. 333 `#1969 <https://github.com/pybind/pybind11/pull/1969>`_ 334 335* ``py::capsule`` supports ``get_pointer`` and ``set_pointer``. 336 `#1131 <https://github.com/pybind/pybind11/pull/1131>`_ 337 338* Fix crash when different instances share the same pointer of the same type. 339 `#2252 <https://github.com/pybind/pybind11/pull/2252>`_ 340 341* Fix for ``py::len`` not clearing Python's error state when it fails and throws. 342 `#2575 <https://github.com/pybind/pybind11/pull/2575>`_ 343 344* Bugfixes related to more extensive testing, new GitHub Actions CI. 345 `#2321 <https://github.com/pybind/pybind11/pull/2321>`_ 346 347* Bug in timezone issue in Eastern hemisphere midnight fixed. 348 `#2438 <https://github.com/pybind/pybind11/pull/2438>`_ 349 350* ``std::chrono::time_point`` now works when the resolution is not the same as 351 the system. 352 `#2481 <https://github.com/pybind/pybind11/pull/2481>`_ 353 354* Bug fixed where ``py::array_t`` could accept arrays that did not match the 355 requested ordering. 356 `#2484 <https://github.com/pybind/pybind11/pull/2484>`_ 357 358* Avoid a segfault on some compilers when types are removed in Python. 359 `#2564 <https://github.com/pybind/pybind11/pull/2564>`_ 360 361* ``py::arg::none()`` is now also respected when passing keyword arguments. 362 `#2611 <https://github.com/pybind/pybind11/pull/2611>`_ 363 364* PyPy fixes, PyPy 7.3.x now supported, including PyPy3. (Known issue with 365 PyPy2 and Windows `#2596 <https://github.com/pybind/pybind11/issues/2596>`_). 366 `#2146 <https://github.com/pybind/pybind11/pull/2146>`_ 367 368* CPython 3.9.0 workaround for undefined behavior (macOS segfault). 369 `#2576 <https://github.com/pybind/pybind11/pull/2576>`_ 370 371* CPython 3.9 warning fixes. 372 `#2253 <https://github.com/pybind/pybind11/pull/2253>`_ 373 374* Improved C++20 support, now tested in CI. 375 `#2489 <https://github.com/pybind/pybind11/pull/2489>`_ 376 `#2599 <https://github.com/pybind/pybind11/pull/2599>`_ 377 378* Improved but still incomplete debug Python interpreter support. 379 `#2025 <https://github.com/pybind/pybind11/pull/2025>`_ 380 381* NVCC (CUDA 11) now supported and tested in CI. 382 `#2461 <https://github.com/pybind/pybind11/pull/2461>`_ 383 384* NVIDIA PGI compilers now supported and tested in CI. 385 `#2475 <https://github.com/pybind/pybind11/pull/2475>`_ 386 387* At least Intel 18 now explicitly required when compiling with Intel. 388 `#2577 <https://github.com/pybind/pybind11/pull/2577>`_ 389 390* Extensive style checking in CI, with `pre-commit`_ support. Code 391 modernization, checked by clang-tidy. 392 393* Expanded docs, including new main page, new installing section, and CMake 394 helpers page, along with over a dozen new sections on existing pages. 395 396* In GitHub, new docs for contributing and new issue templates. 397 398.. _pre-commit: https://pre-commit.com 399 400.. _pybind11-mkdoc: https://github.com/pybind/pybind11-mkdoc 401 402v2.5.0 (Mar 31, 2020) 403----------------------------------------------------- 404 405* Use C++17 fold expressions in type casters, if available. This can 406 improve performance during overload resolution when functions have 407 multiple arguments. 408 `#2043 <https://github.com/pybind/pybind11/pull/2043>`_. 409 410* Changed include directory resolution in ``pybind11/__init__.py`` 411 and installation in ``setup.py``. This fixes a number of open issues 412 where pybind11 headers could not be found in certain environments. 413 `#1995 <https://github.com/pybind/pybind11/pull/1995>`_. 414 415* C++20 ``char8_t`` and ``u8string`` support. `#2026 416 <https://github.com/pybind/pybind11/pull/2026>`_. 417 418* CMake: search for Python 3.9. `bb9c91 419 <https://github.com/pybind/pybind11/commit/bb9c91>`_. 420 421* Fixes for MSYS-based build environments. 422 `#2087 <https://github.com/pybind/pybind11/pull/2087>`_, 423 `#2053 <https://github.com/pybind/pybind11/pull/2053>`_. 424 425* STL bindings for ``std::vector<...>::clear``. `#2074 426 <https://github.com/pybind/pybind11/pull/2074>`_. 427 428* Read-only flag for ``py::buffer``. `#1466 429 <https://github.com/pybind/pybind11/pull/1466>`_. 430 431* Exception handling during module initialization. 432 `bf2b031 <https://github.com/pybind/pybind11/commit/bf2b031>`_. 433 434* Support linking against a CPython debug build. 435 `#2025 <https://github.com/pybind/pybind11/pull/2025>`_. 436 437* Fixed issues involving the availability and use of aligned ``new`` and 438 ``delete``. `#1988 <https://github.com/pybind/pybind11/pull/1988>`_, 439 `759221 <https://github.com/pybind/pybind11/commit/759221>`_. 440 441* Fixed a resource leak upon interpreter shutdown. 442 `#2020 <https://github.com/pybind/pybind11/pull/2020>`_. 443 444* Fixed error handling in the boolean caster. 445 `#1976 <https://github.com/pybind/pybind11/pull/1976>`_. 446 447v2.4.3 (Oct 15, 2019) 448----------------------------------------------------- 449 450* Adapt pybind11 to a C API convention change in Python 3.8. `#1950 451 <https://github.com/pybind/pybind11/pull/1950>`_. 452 453v2.4.2 (Sep 21, 2019) 454----------------------------------------------------- 455 456* Replaced usage of a C++14 only construct. `#1929 457 <https://github.com/pybind/pybind11/pull/1929>`_. 458 459* Made an ifdef future-proof for Python >= 4. `f3109d 460 <https://github.com/pybind/pybind11/commit/f3109d>`_. 461 462v2.4.1 (Sep 20, 2019) 463----------------------------------------------------- 464 465* Fixed a problem involving implicit conversion from enumerations to integers 466 on Python 3.8. `#1780 <https://github.com/pybind/pybind11/pull/1780>`_. 467 468v2.4.0 (Sep 19, 2019) 469----------------------------------------------------- 470 471* Try harder to keep pybind11-internal data structures separate when there 472 are potential ABI incompatibilities. Fixes crashes that occurred when loading 473 multiple pybind11 extensions that were e.g. compiled by GCC (libstdc++) 474 and Clang (libc++). 475 `#1588 <https://github.com/pybind/pybind11/pull/1588>`_ and 476 `c9f5a <https://github.com/pybind/pybind11/commit/c9f5a>`_. 477 478* Added support for ``__await__``, ``__aiter__``, and ``__anext__`` protocols. 479 `#1842 <https://github.com/pybind/pybind11/pull/1842>`_. 480 481* ``pybind11_add_module()``: don't strip symbols when compiling in 482 ``RelWithDebInfo`` mode. `#1980 483 <https://github.com/pybind/pybind11/pull/1980>`_. 484 485* ``enum_``: Reproduce Python behavior when comparing against invalid values 486 (e.g. ``None``, strings, etc.). Add back support for ``__invert__()``. 487 `#1912 <https://github.com/pybind/pybind11/pull/1912>`_, 488 `#1907 <https://github.com/pybind/pybind11/pull/1907>`_. 489 490* List insertion operation for ``py::list``. 491 Added ``.empty()`` to all collection types. 492 Added ``py::set::contains()`` and ``py::dict::contains()``. 493 `#1887 <https://github.com/pybind/pybind11/pull/1887>`_, 494 `#1884 <https://github.com/pybind/pybind11/pull/1884>`_, 495 `#1888 <https://github.com/pybind/pybind11/pull/1888>`_. 496 497* ``py::details::overload_cast_impl`` is available in C++11 mode, can be used 498 like ``overload_cast`` with an additional set of parantheses. 499 `#1581 <https://github.com/pybind/pybind11/pull/1581>`_. 500 501* Fixed ``get_include()`` on Conda. 502 `#1877 <https://github.com/pybind/pybind11/pull/1877>`_. 503 504* ``stl_bind.h``: negative indexing support. 505 `#1882 <https://github.com/pybind/pybind11/pull/1882>`_. 506 507* Minor CMake fix to add MinGW compatibility. 508 `#1851 <https://github.com/pybind/pybind11/pull/1851>`_. 509 510* GIL-related fixes. 511 `#1836 <https://github.com/pybind/pybind11/pull/1836>`_, 512 `8b90b <https://github.com/pybind/pybind11/commit/8b90b>`_. 513 514* Other very minor/subtle fixes and improvements. 515 `#1329 <https://github.com/pybind/pybind11/pull/1329>`_, 516 `#1910 <https://github.com/pybind/pybind11/pull/1910>`_, 517 `#1863 <https://github.com/pybind/pybind11/pull/1863>`_, 518 `#1847 <https://github.com/pybind/pybind11/pull/1847>`_, 519 `#1890 <https://github.com/pybind/pybind11/pull/1890>`_, 520 `#1860 <https://github.com/pybind/pybind11/pull/1860>`_, 521 `#1848 <https://github.com/pybind/pybind11/pull/1848>`_, 522 `#1821 <https://github.com/pybind/pybind11/pull/1821>`_, 523 `#1837 <https://github.com/pybind/pybind11/pull/1837>`_, 524 `#1833 <https://github.com/pybind/pybind11/pull/1833>`_, 525 `#1748 <https://github.com/pybind/pybind11/pull/1748>`_, 526 `#1852 <https://github.com/pybind/pybind11/pull/1852>`_. 527 528v2.3.0 (June 11, 2019) 529----------------------------------------------------- 530 531* Significantly reduced module binary size (10-20%) when compiled in C++11 mode 532 with GCC/Clang, or in any mode with MSVC. Function signatures are now always 533 precomputed at compile time (this was previously only available in C++14 mode 534 for non-MSVC compilers). 535 `#934 <https://github.com/pybind/pybind11/pull/934>`_. 536 537* Add basic support for tag-based static polymorphism, where classes 538 provide a method to returns the desired type of an instance. 539 `#1326 <https://github.com/pybind/pybind11/pull/1326>`_. 540 541* Python type wrappers (``py::handle``, ``py::object``, etc.) 542 now support map Python's number protocol onto C++ arithmetic 543 operators such as ``operator+``, ``operator/=``, etc. 544 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_. 545 546* A number of improvements related to enumerations: 547 548 1. The ``enum_`` implementation was rewritten from scratch to reduce 549 code bloat. Rather than instantiating a full implementation for each 550 enumeration, most code is now contained in a generic base class. 551 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_. 552 553 2. The ``value()`` method of ``py::enum_`` now accepts an optional 554 docstring that will be shown in the documentation of the associated 555 enumeration. `#1160 <https://github.com/pybind/pybind11/pull/1160>`_. 556 557 3. check for already existing enum value and throw an error if present. 558 `#1453 <https://github.com/pybind/pybind11/pull/1453>`_. 559 560* Support for over-aligned type allocation via C++17's aligned ``new`` 561 statement. `#1582 <https://github.com/pybind/pybind11/pull/1582>`_. 562 563* Added ``py::ellipsis()`` method for slicing of multidimensional NumPy arrays 564 `#1502 <https://github.com/pybind/pybind11/pull/1502>`_. 565 566* Numerous Improvements to the ``mkdoc.py`` script for extracting documentation 567 from C++ header files. 568 `#1788 <https://github.com/pybind/pybind11/pull/1788>`_. 569 570* ``pybind11_add_module()``: allow including Python as a ``SYSTEM`` include path. 571 `#1416 <https://github.com/pybind/pybind11/pull/1416>`_. 572 573* ``pybind11/stl.h`` does not convert strings to ``vector<string>`` anymore. 574 `#1258 <https://github.com/pybind/pybind11/issues/1258>`_. 575 576* Mark static methods as such to fix auto-generated Sphinx documentation. 577 `#1732 <https://github.com/pybind/pybind11/pull/1732>`_. 578 579* Re-throw forced unwind exceptions (e.g. during pthread termination). 580 `#1208 <https://github.com/pybind/pybind11/pull/1208>`_. 581 582* Added ``__contains__`` method to the bindings of maps (``std::map``, 583 ``std::unordered_map``). 584 `#1767 <https://github.com/pybind/pybind11/pull/1767>`_. 585 586* Improvements to ``gil_scoped_acquire``. 587 `#1211 <https://github.com/pybind/pybind11/pull/1211>`_. 588 589* Type caster support for ``std::deque<T>``. 590 `#1609 <https://github.com/pybind/pybind11/pull/1609>`_. 591 592* Support for ``std::unique_ptr`` holders, whose deleters differ between a base and derived 593 class. `#1353 <https://github.com/pybind/pybind11/pull/1353>`_. 594 595* Construction of STL array/vector-like data structures from 596 iterators. Added an ``extend()`` operation. 597 `#1709 <https://github.com/pybind/pybind11/pull/1709>`_, 598 599* CMake build system improvements for projects that include non-C++ 600 files (e.g. plain C, CUDA) in ``pybind11_add_module`` et al. 601 `#1678 <https://github.com/pybind/pybind11/pull/1678>`_. 602 603* Fixed asynchronous invocation and deallocation of Python functions 604 wrapped in ``std::function``. 605 `#1595 <https://github.com/pybind/pybind11/pull/1595>`_. 606 607* Fixes regarding return value policy propagation in STL type casters. 608 `#1603 <https://github.com/pybind/pybind11/pull/1603>`_. 609 610* Fixed scoped enum comparisons. 611 `#1571 <https://github.com/pybind/pybind11/pull/1571>`_. 612 613* Fixed iostream redirection for code that releases the GIL. 614 `#1368 <https://github.com/pybind/pybind11/pull/1368>`_, 615 616* A number of CI-related fixes. 617 `#1757 <https://github.com/pybind/pybind11/pull/1757>`_, 618 `#1744 <https://github.com/pybind/pybind11/pull/1744>`_, 619 `#1670 <https://github.com/pybind/pybind11/pull/1670>`_. 620 621v2.2.4 (September 11, 2018) 622----------------------------------------------------- 623 624* Use new Python 3.7 Thread Specific Storage (TSS) implementation if available. 625 `#1454 <https://github.com/pybind/pybind11/pull/1454>`_, 626 `#1517 <https://github.com/pybind/pybind11/pull/1517>`_. 627 628* Fixes for newer MSVC versions and C++17 mode. 629 `#1347 <https://github.com/pybind/pybind11/pull/1347>`_, 630 `#1462 <https://github.com/pybind/pybind11/pull/1462>`_. 631 632* Propagate return value policies to type-specific casters 633 when casting STL containers. 634 `#1455 <https://github.com/pybind/pybind11/pull/1455>`_. 635 636* Allow ostream-redirection of more than 1024 characters. 637 `#1479 <https://github.com/pybind/pybind11/pull/1479>`_. 638 639* Set ``Py_DEBUG`` define when compiling against a debug Python build. 640 `#1438 <https://github.com/pybind/pybind11/pull/1438>`_. 641 642* Untangle integer logic in number type caster to work for custom 643 types that may only be castable to a restricted set of builtin types. 644 `#1442 <https://github.com/pybind/pybind11/pull/1442>`_. 645 646* CMake build system: Remember Python version in cache file. 647 `#1434 <https://github.com/pybind/pybind11/pull/1434>`_. 648 649* Fix for custom smart pointers: use ``std::addressof`` to obtain holder 650 address instead of ``operator&``. 651 `#1435 <https://github.com/pybind/pybind11/pull/1435>`_. 652 653* Properly report exceptions thrown during module initialization. 654 `#1362 <https://github.com/pybind/pybind11/pull/1362>`_. 655 656* Fixed a segmentation fault when creating empty-shaped NumPy array. 657 `#1371 <https://github.com/pybind/pybind11/pull/1371>`_. 658 659* The version of Intel C++ compiler must be >= 2017, and this is now checked by 660 the header files. `#1363 <https://github.com/pybind/pybind11/pull/1363>`_. 661 662* A few minor typo fixes and improvements to the test suite, and 663 patches that silence compiler warnings. 664 665* Vectors now support construction from generators, as well as ``extend()`` from a 666 list or generator. 667 `#1496 <https://github.com/pybind/pybind11/pull/1496>`_. 668 669 670v2.2.3 (April 29, 2018) 671----------------------------------------------------- 672 673* The pybind11 header location detection was replaced by a new implementation 674 that no longer depends on ``pip`` internals (the recently released ``pip`` 675 10 has restricted access to this API). 676 `#1190 <https://github.com/pybind/pybind11/pull/1190>`_. 677 678* Small adjustment to an implementation detail to work around a compiler segmentation fault in Clang 3.3/3.4. 679 `#1350 <https://github.com/pybind/pybind11/pull/1350>`_. 680 681* The minimal supported version of the Intel compiler was >= 17.0 since 682 pybind11 v2.1. This check is now explicit, and a compile-time error is raised 683 if the compiler meet the requirement. 684 `#1363 <https://github.com/pybind/pybind11/pull/1363>`_. 685 686* Fixed an endianness-related fault in the test suite. 687 `#1287 <https://github.com/pybind/pybind11/pull/1287>`_. 688 689v2.2.2 (February 7, 2018) 690----------------------------------------------------- 691 692* Fixed a segfault when combining embedded interpreter 693 shutdown/reinitialization with external loaded pybind11 modules. 694 `#1092 <https://github.com/pybind/pybind11/pull/1092>`_. 695 696* Eigen support: fixed a bug where Nx1/1xN numpy inputs couldn't be passed as 697 arguments to Eigen vectors (which for Eigen are simply compile-time fixed 698 Nx1/1xN matrices). 699 `#1106 <https://github.com/pybind/pybind11/pull/1106>`_. 700 701* Clarified to license by moving the licensing of contributions from 702 ``LICENSE`` into ``CONTRIBUTING.md``: the licensing of contributions is not 703 actually part of the software license as distributed. This isn't meant to be 704 a substantial change in the licensing of the project, but addresses concerns 705 that the clause made the license non-standard. 706 `#1109 <https://github.com/pybind/pybind11/issues/1109>`_. 707 708* Fixed a regression introduced in 2.1 that broke binding functions with lvalue 709 character literal arguments. 710 `#1128 <https://github.com/pybind/pybind11/pull/1128>`_. 711 712* MSVC: fix for compilation failures under /permissive-, and added the flag to 713 the appveyor test suite. 714 `#1155 <https://github.com/pybind/pybind11/pull/1155>`_. 715 716* Fixed ``__qualname__`` generation, and in turn, fixes how class names 717 (especially nested class names) are shown in generated docstrings. 718 `#1171 <https://github.com/pybind/pybind11/pull/1171>`_. 719 720* Updated the FAQ with a suggested project citation reference. 721 `#1189 <https://github.com/pybind/pybind11/pull/1189>`_. 722 723* Added fixes for deprecation warnings when compiled under C++17 with 724 ``-Wdeprecated`` turned on, and add ``-Wdeprecated`` to the test suite 725 compilation flags. 726 `#1191 <https://github.com/pybind/pybind11/pull/1191>`_. 727 728* Fixed outdated PyPI URLs in ``setup.py``. 729 `#1213 <https://github.com/pybind/pybind11/pull/1213>`_. 730 731* Fixed a refcount leak for arguments that end up in a ``py::args`` argument 732 for functions with both fixed positional and ``py::args`` arguments. 733 `#1216 <https://github.com/pybind/pybind11/pull/1216>`_. 734 735* Fixed a potential segfault resulting from possible premature destruction of 736 ``py::args``/``py::kwargs`` arguments with overloaded functions. 737 `#1223 <https://github.com/pybind/pybind11/pull/1223>`_. 738 739* Fixed ``del map[item]`` for a ``stl_bind.h`` bound stl map. 740 `#1229 <https://github.com/pybind/pybind11/pull/1229>`_. 741 742* Fixed a regression from v2.1.x where the aggregate initialization could 743 unintentionally end up at a constructor taking a templated 744 ``std::initializer_list<T>`` argument. 745 `#1249 <https://github.com/pybind/pybind11/pull/1249>`_. 746 747* Fixed an issue where calling a function with a keep_alive policy on the same 748 nurse/patient pair would cause the internal patient storage to needlessly 749 grow (unboundedly, if the nurse is long-lived). 750 `#1251 <https://github.com/pybind/pybind11/issues/1251>`_. 751 752* Various other minor fixes. 753 754v2.2.1 (September 14, 2017) 755----------------------------------------------------- 756 757* Added ``py::module_::reload()`` member function for reloading a module. 758 `#1040 <https://github.com/pybind/pybind11/pull/1040>`_. 759 760* Fixed a reference leak in the number converter. 761 `#1078 <https://github.com/pybind/pybind11/pull/1078>`_. 762 763* Fixed compilation with Clang on host GCC < 5 (old libstdc++ which isn't fully 764 C++11 compliant). `#1062 <https://github.com/pybind/pybind11/pull/1062>`_. 765 766* Fixed a regression where the automatic ``std::vector<bool>`` caster would 767 fail to compile. The same fix also applies to any container which returns 768 element proxies instead of references. 769 `#1053 <https://github.com/pybind/pybind11/pull/1053>`_. 770 771* Fixed a regression where the ``py::keep_alive`` policy could not be applied 772 to constructors. `#1065 <https://github.com/pybind/pybind11/pull/1065>`_. 773 774* Fixed a nullptr dereference when loading a ``py::module_local`` type 775 that's only registered in an external module. 776 `#1058 <https://github.com/pybind/pybind11/pull/1058>`_. 777 778* Fixed implicit conversion of accessors to types derived from ``py::object``. 779 `#1076 <https://github.com/pybind/pybind11/pull/1076>`_. 780 781* The ``name`` in ``PYBIND11_MODULE(name, variable)`` can now be a macro. 782 `#1082 <https://github.com/pybind/pybind11/pull/1082>`_. 783 784* Relaxed overly strict ``py::pickle()`` check for matching get and set types. 785 `#1064 <https://github.com/pybind/pybind11/pull/1064>`_. 786 787* Conversion errors now try to be more informative when it's likely that 788 a missing header is the cause (e.g. forgetting ``<pybind11/stl.h>``). 789 `#1077 <https://github.com/pybind/pybind11/pull/1077>`_. 790 791v2.2.0 (August 31, 2017) 792----------------------------------------------------- 793 794* Support for embedding the Python interpreter. See the 795 :doc:`documentation page </advanced/embedding>` for a 796 full overview of the new features. 797 `#774 <https://github.com/pybind/pybind11/pull/774>`_, 798 `#889 <https://github.com/pybind/pybind11/pull/889>`_, 799 `#892 <https://github.com/pybind/pybind11/pull/892>`_, 800 `#920 <https://github.com/pybind/pybind11/pull/920>`_. 801 802 .. code-block:: cpp 803 804 #include <pybind11/embed.h> 805 namespace py = pybind11; 806 807 int main() { 808 py::scoped_interpreter guard{}; // start the interpreter and keep it alive 809 810 py::print("Hello, World!"); // use the Python API 811 } 812 813* Support for inheriting from multiple C++ bases in Python. 814 `#693 <https://github.com/pybind/pybind11/pull/693>`_. 815 816 .. code-block:: python 817 818 from cpp_module import CppBase1, CppBase2 819 820 class PyDerived(CppBase1, CppBase2): 821 def __init__(self): 822 CppBase1.__init__(self) # C++ bases must be initialized explicitly 823 CppBase2.__init__(self) 824 825* ``PYBIND11_MODULE`` is now the preferred way to create module entry points. 826 ``PYBIND11_PLUGIN`` is deprecated. See :ref:`macros` for details. 827 `#879 <https://github.com/pybind/pybind11/pull/879>`_. 828 829 .. code-block:: cpp 830 831 // new 832 PYBIND11_MODULE(example, m) { 833 m.def("add", [](int a, int b) { return a + b; }); 834 } 835 836 // old 837 PYBIND11_PLUGIN(example) { 838 py::module m("example"); 839 m.def("add", [](int a, int b) { return a + b; }); 840 return m.ptr(); 841 } 842 843* pybind11's headers and build system now more strictly enforce hidden symbol 844 visibility for extension modules. This should be seamless for most users, 845 but see the :doc:`upgrade` if you use a custom build system. 846 `#995 <https://github.com/pybind/pybind11/pull/995>`_. 847 848* Support for ``py::module_local`` types which allow multiple modules to 849 export the same C++ types without conflicts. This is useful for opaque 850 types like ``std::vector<int>``. ``py::bind_vector`` and ``py::bind_map`` 851 now default to ``py::module_local`` if their elements are builtins or 852 local types. See :ref:`module_local` for details. 853 `#949 <https://github.com/pybind/pybind11/pull/949>`_, 854 `#981 <https://github.com/pybind/pybind11/pull/981>`_, 855 `#995 <https://github.com/pybind/pybind11/pull/995>`_, 856 `#997 <https://github.com/pybind/pybind11/pull/997>`_. 857 858* Custom constructors can now be added very easily using lambdas or factory 859 functions which return a class instance by value, pointer or holder. This 860 supersedes the old placement-new ``__init__`` technique. 861 See :ref:`custom_constructors` for details. 862 `#805 <https://github.com/pybind/pybind11/pull/805>`_, 863 `#1014 <https://github.com/pybind/pybind11/pull/1014>`_. 864 865 .. code-block:: cpp 866 867 struct Example { 868 Example(std::string); 869 }; 870 871 py::class_<Example>(m, "Example") 872 .def(py::init<std::string>()) // existing constructor 873 .def(py::init([](int n) { // custom constructor 874 return std::make_unique<Example>(std::to_string(n)); 875 })); 876 877* Similarly to custom constructors, pickling support functions are now bound 878 using the ``py::pickle()`` adaptor which improves type safety. See the 879 :doc:`upgrade` and :ref:`pickling` for details. 880 `#1038 <https://github.com/pybind/pybind11/pull/1038>`_. 881 882* Builtin support for converting C++17 standard library types and general 883 conversion improvements: 884 885 1. C++17 ``std::variant`` is supported right out of the box. C++11/14 886 equivalents (e.g. ``boost::variant``) can also be added with a simple 887 user-defined specialization. See :ref:`cpp17_container_casters` for details. 888 `#811 <https://github.com/pybind/pybind11/pull/811>`_, 889 `#845 <https://github.com/pybind/pybind11/pull/845>`_, 890 `#989 <https://github.com/pybind/pybind11/pull/989>`_. 891 892 2. Out-of-the-box support for C++17 ``std::string_view``. 893 `#906 <https://github.com/pybind/pybind11/pull/906>`_. 894 895 3. Improved compatibility of the builtin ``optional`` converter. 896 `#874 <https://github.com/pybind/pybind11/pull/874>`_. 897 898 4. The ``bool`` converter now accepts ``numpy.bool_`` and types which 899 define ``__bool__`` (Python 3.x) or ``__nonzero__`` (Python 2.7). 900 `#925 <https://github.com/pybind/pybind11/pull/925>`_. 901 902 5. C++-to-Python casters are now more efficient and move elements out 903 of rvalue containers whenever possible. 904 `#851 <https://github.com/pybind/pybind11/pull/851>`_, 905 `#936 <https://github.com/pybind/pybind11/pull/936>`_, 906 `#938 <https://github.com/pybind/pybind11/pull/938>`_. 907 908 6. Fixed ``bytes`` to ``std::string/char*`` conversion on Python 3. 909 `#817 <https://github.com/pybind/pybind11/pull/817>`_. 910 911 7. Fixed lifetime of temporary C++ objects created in Python-to-C++ conversions. 912 `#924 <https://github.com/pybind/pybind11/pull/924>`_. 913 914* Scope guard call policy for RAII types, e.g. ``py::call_guard<py::gil_scoped_release>()``, 915 ``py::call_guard<py::scoped_ostream_redirect>()``. See :ref:`call_policies` for details. 916 `#740 <https://github.com/pybind/pybind11/pull/740>`_. 917 918* Utility for redirecting C++ streams to Python (e.g. ``std::cout`` -> 919 ``sys.stdout``). Scope guard ``py::scoped_ostream_redirect`` in C++ and 920 a context manager in Python. See :ref:`ostream_redirect`. 921 `#1009 <https://github.com/pybind/pybind11/pull/1009>`_. 922 923* Improved handling of types and exceptions across module boundaries. 924 `#915 <https://github.com/pybind/pybind11/pull/915>`_, 925 `#951 <https://github.com/pybind/pybind11/pull/951>`_, 926 `#995 <https://github.com/pybind/pybind11/pull/995>`_. 927 928* Fixed destruction order of ``py::keep_alive`` nurse/patient objects 929 in reference cycles. 930 `#856 <https://github.com/pybind/pybind11/pull/856>`_. 931 932* NumPy and buffer protocol related improvements: 933 934 1. Support for negative strides in Python buffer objects/numpy arrays. This 935 required changing integers from unsigned to signed for the related C++ APIs. 936 Note: If you have compiler warnings enabled, you may notice some new conversion 937 warnings after upgrading. These can be resolved with ``static_cast``. 938 `#782 <https://github.com/pybind/pybind11/pull/782>`_. 939 940 2. Support ``std::complex`` and arrays inside ``PYBIND11_NUMPY_DTYPE``. 941 `#831 <https://github.com/pybind/pybind11/pull/831>`_, 942 `#832 <https://github.com/pybind/pybind11/pull/832>`_. 943 944 3. Support for constructing ``py::buffer_info`` and ``py::arrays`` using 945 arbitrary containers or iterators instead of requiring a ``std::vector``. 946 `#788 <https://github.com/pybind/pybind11/pull/788>`_, 947 `#822 <https://github.com/pybind/pybind11/pull/822>`_, 948 `#860 <https://github.com/pybind/pybind11/pull/860>`_. 949 950 4. Explicitly check numpy version and require >= 1.7.0. 951 `#819 <https://github.com/pybind/pybind11/pull/819>`_. 952 953* Support for allowing/prohibiting ``None`` for specific arguments and improved 954 ``None`` overload resolution order. See :ref:`none_arguments` for details. 955 `#843 <https://github.com/pybind/pybind11/pull/843>`_. 956 `#859 <https://github.com/pybind/pybind11/pull/859>`_. 957 958* Added ``py::exec()`` as a shortcut for ``py::eval<py::eval_statements>()`` 959 and support for C++11 raw string literals as input. See :ref:`eval`. 960 `#766 <https://github.com/pybind/pybind11/pull/766>`_, 961 `#827 <https://github.com/pybind/pybind11/pull/827>`_. 962 963* ``py::vectorize()`` ignores non-vectorizable arguments and supports 964 member functions. 965 `#762 <https://github.com/pybind/pybind11/pull/762>`_. 966 967* Support for bound methods as callbacks (``pybind11/functional.h``). 968 `#815 <https://github.com/pybind/pybind11/pull/815>`_. 969 970* Allow aliasing pybind11 methods: ``cls.attr("foo") = cls.attr("bar")``. 971 `#802 <https://github.com/pybind/pybind11/pull/802>`_. 972 973* Don't allow mixed static/non-static overloads. 974 `#804 <https://github.com/pybind/pybind11/pull/804>`_. 975 976* Fixed overriding static properties in derived classes. 977 `#784 <https://github.com/pybind/pybind11/pull/784>`_. 978 979* Added support for write only properties. 980 `#1144 <https://github.com/pybind/pybind11/pull/1144>`_. 981 982* Improved deduction of member functions of a derived class when its bases 983 aren't registered with pybind11. 984 `#855 <https://github.com/pybind/pybind11/pull/855>`_. 985 986 .. code-block:: cpp 987 988 struct Base { 989 int foo() { return 42; } 990 } 991 992 struct Derived : Base {} 993 994 // Now works, but previously required also binding `Base` 995 py::class_<Derived>(m, "Derived") 996 .def("foo", &Derived::foo); // function is actually from `Base` 997 998* The implementation of ``py::init<>`` now uses C++11 brace initialization 999 syntax to construct instances, which permits binding implicit constructors of 1000 aggregate types. `#1015 <https://github.com/pybind/pybind11/pull/1015>`_. 1001 1002 .. code-block:: cpp 1003 1004 struct Aggregate { 1005 int a; 1006 std::string b; 1007 }; 1008 1009 py::class_<Aggregate>(m, "Aggregate") 1010 .def(py::init<int, const std::string &>()); 1011 1012* Fixed issues with multiple inheritance with offset base/derived pointers. 1013 `#812 <https://github.com/pybind/pybind11/pull/812>`_, 1014 `#866 <https://github.com/pybind/pybind11/pull/866>`_, 1015 `#960 <https://github.com/pybind/pybind11/pull/960>`_. 1016 1017* Fixed reference leak of type objects. 1018 `#1030 <https://github.com/pybind/pybind11/pull/1030>`_. 1019 1020* Improved support for the ``/std:c++14`` and ``/std:c++latest`` modes 1021 on MSVC 2017. 1022 `#841 <https://github.com/pybind/pybind11/pull/841>`_, 1023 `#999 <https://github.com/pybind/pybind11/pull/999>`_. 1024 1025* Fixed detection of private operator new on MSVC. 1026 `#893 <https://github.com/pybind/pybind11/pull/893>`_, 1027 `#918 <https://github.com/pybind/pybind11/pull/918>`_. 1028 1029* Intel C++ compiler compatibility fixes. 1030 `#937 <https://github.com/pybind/pybind11/pull/937>`_. 1031 1032* Fixed implicit conversion of `py::enum_` to integer types on Python 2.7. 1033 `#821 <https://github.com/pybind/pybind11/pull/821>`_. 1034 1035* Added ``py::hash`` to fetch the hash value of Python objects, and 1036 ``.def(hash(py::self))`` to provide the C++ ``std::hash`` as the Python 1037 ``__hash__`` method. 1038 `#1034 <https://github.com/pybind/pybind11/pull/1034>`_. 1039 1040* Fixed ``__truediv__`` on Python 2 and ``__itruediv__`` on Python 3. 1041 `#867 <https://github.com/pybind/pybind11/pull/867>`_. 1042 1043* ``py::capsule`` objects now support the ``name`` attribute. This is useful 1044 for interfacing with ``scipy.LowLevelCallable``. 1045 `#902 <https://github.com/pybind/pybind11/pull/902>`_. 1046 1047* Fixed ``py::make_iterator``'s ``__next__()`` for past-the-end calls. 1048 `#897 <https://github.com/pybind/pybind11/pull/897>`_. 1049 1050* Added ``error_already_set::matches()`` for checking Python exceptions. 1051 `#772 <https://github.com/pybind/pybind11/pull/772>`_. 1052 1053* Deprecated ``py::error_already_set::clear()``. It's no longer needed 1054 following a simplification of the ``py::error_already_set`` class. 1055 `#954 <https://github.com/pybind/pybind11/pull/954>`_. 1056 1057* Deprecated ``py::handle::operator==()`` in favor of ``py::handle::is()`` 1058 `#825 <https://github.com/pybind/pybind11/pull/825>`_. 1059 1060* Deprecated ``py::object::borrowed``/``py::object::stolen``. 1061 Use ``py::object::borrowed_t{}``/``py::object::stolen_t{}`` instead. 1062 `#771 <https://github.com/pybind/pybind11/pull/771>`_. 1063 1064* Changed internal data structure versioning to avoid conflicts between 1065 modules compiled with different revisions of pybind11. 1066 `#1012 <https://github.com/pybind/pybind11/pull/1012>`_. 1067 1068* Additional compile-time and run-time error checking and more informative messages. 1069 `#786 <https://github.com/pybind/pybind11/pull/786>`_, 1070 `#794 <https://github.com/pybind/pybind11/pull/794>`_, 1071 `#803 <https://github.com/pybind/pybind11/pull/803>`_. 1072 1073* Various minor improvements and fixes. 1074 `#764 <https://github.com/pybind/pybind11/pull/764>`_, 1075 `#791 <https://github.com/pybind/pybind11/pull/791>`_, 1076 `#795 <https://github.com/pybind/pybind11/pull/795>`_, 1077 `#840 <https://github.com/pybind/pybind11/pull/840>`_, 1078 `#844 <https://github.com/pybind/pybind11/pull/844>`_, 1079 `#846 <https://github.com/pybind/pybind11/pull/846>`_, 1080 `#849 <https://github.com/pybind/pybind11/pull/849>`_, 1081 `#858 <https://github.com/pybind/pybind11/pull/858>`_, 1082 `#862 <https://github.com/pybind/pybind11/pull/862>`_, 1083 `#871 <https://github.com/pybind/pybind11/pull/871>`_, 1084 `#872 <https://github.com/pybind/pybind11/pull/872>`_, 1085 `#881 <https://github.com/pybind/pybind11/pull/881>`_, 1086 `#888 <https://github.com/pybind/pybind11/pull/888>`_, 1087 `#899 <https://github.com/pybind/pybind11/pull/899>`_, 1088 `#928 <https://github.com/pybind/pybind11/pull/928>`_, 1089 `#931 <https://github.com/pybind/pybind11/pull/931>`_, 1090 `#944 <https://github.com/pybind/pybind11/pull/944>`_, 1091 `#950 <https://github.com/pybind/pybind11/pull/950>`_, 1092 `#952 <https://github.com/pybind/pybind11/pull/952>`_, 1093 `#962 <https://github.com/pybind/pybind11/pull/962>`_, 1094 `#965 <https://github.com/pybind/pybind11/pull/965>`_, 1095 `#970 <https://github.com/pybind/pybind11/pull/970>`_, 1096 `#978 <https://github.com/pybind/pybind11/pull/978>`_, 1097 `#979 <https://github.com/pybind/pybind11/pull/979>`_, 1098 `#986 <https://github.com/pybind/pybind11/pull/986>`_, 1099 `#1020 <https://github.com/pybind/pybind11/pull/1020>`_, 1100 `#1027 <https://github.com/pybind/pybind11/pull/1027>`_, 1101 `#1037 <https://github.com/pybind/pybind11/pull/1037>`_. 1102 1103* Testing improvements. 1104 `#798 <https://github.com/pybind/pybind11/pull/798>`_, 1105 `#882 <https://github.com/pybind/pybind11/pull/882>`_, 1106 `#898 <https://github.com/pybind/pybind11/pull/898>`_, 1107 `#900 <https://github.com/pybind/pybind11/pull/900>`_, 1108 `#921 <https://github.com/pybind/pybind11/pull/921>`_, 1109 `#923 <https://github.com/pybind/pybind11/pull/923>`_, 1110 `#963 <https://github.com/pybind/pybind11/pull/963>`_. 1111 1112v2.1.1 (April 7, 2017) 1113----------------------------------------------------- 1114 1115* Fixed minimum version requirement for MSVC 2015u3 1116 `#773 <https://github.com/pybind/pybind11/pull/773>`_. 1117 1118v2.1.0 (March 22, 2017) 1119----------------------------------------------------- 1120 1121* pybind11 now performs function overload resolution in two phases. The first 1122 phase only considers exact type matches, while the second allows for implicit 1123 conversions to take place. A special ``noconvert()`` syntax can be used to 1124 completely disable implicit conversions for specific arguments. 1125 `#643 <https://github.com/pybind/pybind11/pull/643>`_, 1126 `#634 <https://github.com/pybind/pybind11/pull/634>`_, 1127 `#650 <https://github.com/pybind/pybind11/pull/650>`_. 1128 1129* Fixed a regression where static properties no longer worked with classes 1130 using multiple inheritance. The ``py::metaclass`` attribute is no longer 1131 necessary (and deprecated as of this release) when binding classes with 1132 static properties. 1133 `#679 <https://github.com/pybind/pybind11/pull/679>`_, 1134 1135* Classes bound using ``pybind11`` can now use custom metaclasses. 1136 `#679 <https://github.com/pybind/pybind11/pull/679>`_, 1137 1138* ``py::args`` and ``py::kwargs`` can now be mixed with other positional 1139 arguments when binding functions using pybind11. 1140 `#611 <https://github.com/pybind/pybind11/pull/611>`_. 1141 1142* Improved support for C++11 unicode string and character types; added 1143 extensive documentation regarding pybind11's string conversion behavior. 1144 `#624 <https://github.com/pybind/pybind11/pull/624>`_, 1145 `#636 <https://github.com/pybind/pybind11/pull/636>`_, 1146 `#715 <https://github.com/pybind/pybind11/pull/715>`_. 1147 1148* pybind11 can now avoid expensive copies when converting Eigen arrays to NumPy 1149 arrays (and vice versa). `#610 <https://github.com/pybind/pybind11/pull/610>`_. 1150 1151* The "fast path" in ``py::vectorize`` now works for any full-size group of C or 1152 F-contiguous arrays. The non-fast path is also faster since it no longer performs 1153 copies of the input arguments (except when type conversions are necessary). 1154 `#610 <https://github.com/pybind/pybind11/pull/610>`_. 1155 1156* Added fast, unchecked access to NumPy arrays via a proxy object. 1157 `#746 <https://github.com/pybind/pybind11/pull/746>`_. 1158 1159* Transparent support for class-specific ``operator new`` and 1160 ``operator delete`` implementations. 1161 `#755 <https://github.com/pybind/pybind11/pull/755>`_. 1162 1163* Slimmer and more efficient STL-compatible iterator interface for sequence types. 1164 `#662 <https://github.com/pybind/pybind11/pull/662>`_. 1165 1166* Improved custom holder type support. 1167 `#607 <https://github.com/pybind/pybind11/pull/607>`_. 1168 1169* ``nullptr`` to ``None`` conversion fixed in various builtin type casters. 1170 `#732 <https://github.com/pybind/pybind11/pull/732>`_. 1171 1172* ``enum_`` now exposes its members via a special ``__members__`` attribute. 1173 `#666 <https://github.com/pybind/pybind11/pull/666>`_. 1174 1175* ``std::vector`` bindings created using ``stl_bind.h`` can now optionally 1176 implement the buffer protocol. `#488 <https://github.com/pybind/pybind11/pull/488>`_. 1177 1178* Automated C++ reference documentation using doxygen and breathe. 1179 `#598 <https://github.com/pybind/pybind11/pull/598>`_. 1180 1181* Added minimum compiler version assertions. 1182 `#727 <https://github.com/pybind/pybind11/pull/727>`_. 1183 1184* Improved compatibility with C++1z. 1185 `#677 <https://github.com/pybind/pybind11/pull/677>`_. 1186 1187* Improved ``py::capsule`` API. Can be used to implement cleanup 1188 callbacks that are involved at module destruction time. 1189 `#752 <https://github.com/pybind/pybind11/pull/752>`_. 1190 1191* Various minor improvements and fixes. 1192 `#595 <https://github.com/pybind/pybind11/pull/595>`_, 1193 `#588 <https://github.com/pybind/pybind11/pull/588>`_, 1194 `#589 <https://github.com/pybind/pybind11/pull/589>`_, 1195 `#603 <https://github.com/pybind/pybind11/pull/603>`_, 1196 `#619 <https://github.com/pybind/pybind11/pull/619>`_, 1197 `#648 <https://github.com/pybind/pybind11/pull/648>`_, 1198 `#695 <https://github.com/pybind/pybind11/pull/695>`_, 1199 `#720 <https://github.com/pybind/pybind11/pull/720>`_, 1200 `#723 <https://github.com/pybind/pybind11/pull/723>`_, 1201 `#729 <https://github.com/pybind/pybind11/pull/729>`_, 1202 `#724 <https://github.com/pybind/pybind11/pull/724>`_, 1203 `#742 <https://github.com/pybind/pybind11/pull/742>`_, 1204 `#753 <https://github.com/pybind/pybind11/pull/753>`_. 1205 1206v2.0.1 (Jan 4, 2017) 1207----------------------------------------------------- 1208 1209* Fix pointer to reference error in type_caster on MSVC 1210 `#583 <https://github.com/pybind/pybind11/pull/583>`_. 1211 1212* Fixed a segmentation in the test suite due to a typo 1213 `cd7eac <https://github.com/pybind/pybind11/commit/cd7eac>`_. 1214 1215v2.0.0 (Jan 1, 2017) 1216----------------------------------------------------- 1217 1218* Fixed a reference counting regression affecting types with custom metaclasses 1219 (introduced in v2.0.0-rc1). 1220 `#571 <https://github.com/pybind/pybind11/pull/571>`_. 1221 1222* Quenched a CMake policy warning. 1223 `#570 <https://github.com/pybind/pybind11/pull/570>`_. 1224 1225v2.0.0-rc1 (Dec 23, 2016) 1226----------------------------------------------------- 1227 1228The pybind11 developers are excited to issue a release candidate of pybind11 1229with a subsequent v2.0.0 release planned in early January next year. 1230 1231An incredible amount of effort by went into pybind11 over the last ~5 months, 1232leading to a release that is jam-packed with exciting new features and numerous 1233usability improvements. The following list links PRs or individual commits 1234whenever applicable. 1235 1236Happy Christmas! 1237 1238* Support for binding C++ class hierarchies that make use of multiple 1239 inheritance. `#410 <https://github.com/pybind/pybind11/pull/410>`_. 1240 1241* PyPy support: pybind11 now supports nightly builds of PyPy and will 1242 interoperate with the future 5.7 release. No code changes are necessary, 1243 everything "just" works as usual. Note that we only target the Python 2.7 1244 branch for now; support for 3.x will be added once its ``cpyext`` extension 1245 support catches up. A few minor features remain unsupported for the time 1246 being (notably dynamic attributes in custom types). 1247 `#527 <https://github.com/pybind/pybind11/pull/527>`_. 1248 1249* Significant work on the documentation -- in particular, the monolithic 1250 ``advanced.rst`` file was restructured into a easier to read hierarchical 1251 organization. `#448 <https://github.com/pybind/pybind11/pull/448>`_. 1252 1253* Many NumPy-related improvements: 1254 1255 1. Object-oriented API to access and modify NumPy ``ndarray`` instances, 1256 replicating much of the corresponding NumPy C API functionality. 1257 `#402 <https://github.com/pybind/pybind11/pull/402>`_. 1258 1259 2. NumPy array ``dtype`` array descriptors are now first-class citizens and 1260 are exposed via a new class ``py::dtype``. 1261 1262 3. Structured dtypes can be registered using the ``PYBIND11_NUMPY_DTYPE()`` 1263 macro. Special ``array`` constructors accepting dtype objects were also 1264 added. 1265 1266 One potential caveat involving this change: format descriptor strings 1267 should now be accessed via ``format_descriptor::format()`` (however, for 1268 compatibility purposes, the old syntax ``format_descriptor::value`` will 1269 still work for non-structured data types). `#308 1270 <https://github.com/pybind/pybind11/pull/308>`_. 1271 1272 4. Further improvements to support structured dtypes throughout the system. 1273 `#472 <https://github.com/pybind/pybind11/pull/472>`_, 1274 `#474 <https://github.com/pybind/pybind11/pull/474>`_, 1275 `#459 <https://github.com/pybind/pybind11/pull/459>`_, 1276 `#453 <https://github.com/pybind/pybind11/pull/453>`_, 1277 `#452 <https://github.com/pybind/pybind11/pull/452>`_, and 1278 `#505 <https://github.com/pybind/pybind11/pull/505>`_. 1279 1280 5. Fast access operators. `#497 <https://github.com/pybind/pybind11/pull/497>`_. 1281 1282 6. Constructors for arrays whose storage is owned by another object. 1283 `#440 <https://github.com/pybind/pybind11/pull/440>`_. 1284 1285 7. Added constructors for ``array`` and ``array_t`` explicitly accepting shape 1286 and strides; if strides are not provided, they are deduced assuming 1287 C-contiguity. Also added simplified constructors for 1-dimensional case. 1288 1289 8. Added buffer/NumPy support for ``char[N]`` and ``std::array<char, N>`` types. 1290 1291 9. Added ``memoryview`` wrapper type which is constructible from ``buffer_info``. 1292 1293* Eigen: many additional conversions and support for non-contiguous 1294 arrays/slices. 1295 `#427 <https://github.com/pybind/pybind11/pull/427>`_, 1296 `#315 <https://github.com/pybind/pybind11/pull/315>`_, 1297 `#316 <https://github.com/pybind/pybind11/pull/316>`_, 1298 `#312 <https://github.com/pybind/pybind11/pull/312>`_, and 1299 `#267 <https://github.com/pybind/pybind11/pull/267>`_ 1300 1301* Incompatible changes in ``class_<...>::class_()``: 1302 1303 1. Declarations of types that provide access via the buffer protocol must 1304 now include the ``py::buffer_protocol()`` annotation as an argument to 1305 the ``class_`` constructor. 1306 1307 2. Declarations of types that require a custom metaclass (i.e. all classes 1308 which include static properties via commands such as 1309 ``def_readwrite_static()``) must now include the ``py::metaclass()`` 1310 annotation as an argument to the ``class_`` constructor. 1311 1312 These two changes were necessary to make type definitions in pybind11 1313 future-proof, and to support PyPy via its cpyext mechanism. `#527 1314 <https://github.com/pybind/pybind11/pull/527>`_. 1315 1316 1317 3. This version of pybind11 uses a redesigned mechanism for instantiating 1318 trampoline classes that are used to override virtual methods from within 1319 Python. This led to the following user-visible syntax change: instead of 1320 1321 .. code-block:: cpp 1322 1323 py::class_<TrampolineClass>("MyClass") 1324 .alias<MyClass>() 1325 .... 1326 1327 write 1328 1329 .. code-block:: cpp 1330 1331 py::class_<MyClass, TrampolineClass>("MyClass") 1332 .... 1333 1334 Importantly, both the original and the trampoline class are now 1335 specified as an arguments (in arbitrary order) to the ``py::class_`` 1336 template, and the ``alias<..>()`` call is gone. The new scheme has zero 1337 overhead in cases when Python doesn't override any functions of the 1338 underlying C++ class. `rev. 86d825 1339 <https://github.com/pybind/pybind11/commit/86d825>`_. 1340 1341* Added ``eval`` and ``eval_file`` functions for evaluating expressions and 1342 statements from a string or file. `rev. 0d3fc3 1343 <https://github.com/pybind/pybind11/commit/0d3fc3>`_. 1344 1345* pybind11 can now create types with a modifiable dictionary. 1346 `#437 <https://github.com/pybind/pybind11/pull/437>`_ and 1347 `#444 <https://github.com/pybind/pybind11/pull/444>`_. 1348 1349* Support for translation of arbitrary C++ exceptions to Python counterparts. 1350 `#296 <https://github.com/pybind/pybind11/pull/296>`_ and 1351 `#273 <https://github.com/pybind/pybind11/pull/273>`_. 1352 1353* Report full backtraces through mixed C++/Python code, better reporting for 1354 import errors, fixed GIL management in exception processing. 1355 `#537 <https://github.com/pybind/pybind11/pull/537>`_, 1356 `#494 <https://github.com/pybind/pybind11/pull/494>`_, 1357 `rev. e72d95 <https://github.com/pybind/pybind11/commit/e72d95>`_, and 1358 `rev. 099d6e <https://github.com/pybind/pybind11/commit/099d6e>`_. 1359 1360* Support for bit-level operations, comparisons, and serialization of C++ 1361 enumerations. `#503 <https://github.com/pybind/pybind11/pull/503>`_, 1362 `#508 <https://github.com/pybind/pybind11/pull/508>`_, 1363 `#380 <https://github.com/pybind/pybind11/pull/380>`_, 1364 `#309 <https://github.com/pybind/pybind11/pull/309>`_. 1365 `#311 <https://github.com/pybind/pybind11/pull/311>`_. 1366 1367* The ``class_`` constructor now accepts its template arguments in any order. 1368 `#385 <https://github.com/pybind/pybind11/pull/385>`_. 1369 1370* Attribute and item accessors now have a more complete interface which makes 1371 it possible to chain attributes as in 1372 ``obj.attr("a")[key].attr("b").attr("method")(1, 2, 3)``. `#425 1373 <https://github.com/pybind/pybind11/pull/425>`_. 1374 1375* Major redesign of the default and conversion constructors in ``pytypes.h``. 1376 `#464 <https://github.com/pybind/pybind11/pull/464>`_. 1377 1378* Added built-in support for ``std::shared_ptr`` holder type. It is no longer 1379 necessary to to include a declaration of the form 1380 ``PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`` (though continuing to 1381 do so won't cause an error). 1382 `#454 <https://github.com/pybind/pybind11/pull/454>`_. 1383 1384* New ``py::overload_cast`` casting operator to select among multiple possible 1385 overloads of a function. An example: 1386 1387 .. code-block:: cpp 1388 1389 py::class_<Pet>(m, "Pet") 1390 .def("set", py::overload_cast<int>(&Pet::set), "Set the pet's age") 1391 .def("set", py::overload_cast<const std::string &>(&Pet::set), "Set the pet's name"); 1392 1393 This feature only works on C++14-capable compilers. 1394 `#541 <https://github.com/pybind/pybind11/pull/541>`_. 1395 1396* C++ types are automatically cast to Python types, e.g. when assigning 1397 them as an attribute. For instance, the following is now legal: 1398 1399 .. code-block:: cpp 1400 1401 py::module m = /* ... */ 1402 m.attr("constant") = 123; 1403 1404 (Previously, a ``py::cast`` call was necessary to avoid a compilation error.) 1405 `#551 <https://github.com/pybind/pybind11/pull/551>`_. 1406 1407* Redesigned ``pytest``-based test suite. `#321 <https://github.com/pybind/pybind11/pull/321>`_. 1408 1409* Instance tracking to detect reference leaks in test suite. `#324 <https://github.com/pybind/pybind11/pull/324>`_ 1410 1411* pybind11 can now distinguish between multiple different instances that are 1412 located at the same memory address, but which have different types. 1413 `#329 <https://github.com/pybind/pybind11/pull/329>`_. 1414 1415* Improved logic in ``move`` return value policy. 1416 `#510 <https://github.com/pybind/pybind11/pull/510>`_, 1417 `#297 <https://github.com/pybind/pybind11/pull/297>`_. 1418 1419* Generalized unpacking API to permit calling Python functions from C++ using 1420 notation such as ``foo(a1, a2, *args, "ka"_a=1, "kb"_a=2, **kwargs)``. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 1421 1422* ``py::print()`` function whose behavior matches that of the native Python 1423 ``print()`` function. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 1424 1425* Added ``py::dict`` keyword constructor:``auto d = dict("number"_a=42, 1426 "name"_a="World");``. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 1427 1428* Added ``py::str::format()`` method and ``_s`` literal: ``py::str s = "1 + 2 1429 = {}"_s.format(3);``. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 1430 1431* Added ``py::repr()`` function which is equivalent to Python's builtin 1432 ``repr()``. `#333 <https://github.com/pybind/pybind11/pull/333>`_. 1433 1434* Improved construction and destruction logic for holder types. It is now 1435 possible to reference instances with smart pointer holder types without 1436 constructing the holder if desired. The ``PYBIND11_DECLARE_HOLDER_TYPE`` 1437 macro now accepts an optional second parameter to indicate whether the holder 1438 type uses intrusive reference counting. 1439 `#533 <https://github.com/pybind/pybind11/pull/533>`_ and 1440 `#561 <https://github.com/pybind/pybind11/pull/561>`_. 1441 1442* Mapping a stateless C++ function to Python and back is now "for free" (i.e. 1443 no extra indirections or argument conversion overheads). `rev. 954b79 1444 <https://github.com/pybind/pybind11/commit/954b79>`_. 1445 1446* Bindings for ``std::valarray<T>``. 1447 `#545 <https://github.com/pybind/pybind11/pull/545>`_. 1448 1449* Improved support for C++17 capable compilers. 1450 `#562 <https://github.com/pybind/pybind11/pull/562>`_. 1451 1452* Bindings for ``std::optional<t>``. 1453 `#475 <https://github.com/pybind/pybind11/pull/475>`_, 1454 `#476 <https://github.com/pybind/pybind11/pull/476>`_, 1455 `#479 <https://github.com/pybind/pybind11/pull/479>`_, 1456 `#499 <https://github.com/pybind/pybind11/pull/499>`_, and 1457 `#501 <https://github.com/pybind/pybind11/pull/501>`_. 1458 1459* ``stl_bind.h``: general improvements and support for ``std::map`` and 1460 ``std::unordered_map``. 1461 `#490 <https://github.com/pybind/pybind11/pull/490>`_, 1462 `#282 <https://github.com/pybind/pybind11/pull/282>`_, 1463 `#235 <https://github.com/pybind/pybind11/pull/235>`_. 1464 1465* The ``std::tuple``, ``std::pair``, ``std::list``, and ``std::vector`` type 1466 casters now accept any Python sequence type as input. `rev. 107285 1467 <https://github.com/pybind/pybind11/commit/107285>`_. 1468 1469* Improved CMake Python detection on multi-architecture Linux. 1470 `#532 <https://github.com/pybind/pybind11/pull/532>`_. 1471 1472* Infrastructure to selectively disable or enable parts of the automatically 1473 generated docstrings. `#486 <https://github.com/pybind/pybind11/pull/486>`_. 1474 1475* ``reference`` and ``reference_internal`` are now the default return value 1476 properties for static and non-static properties, respectively. `#473 1477 <https://github.com/pybind/pybind11/pull/473>`_. (the previous defaults 1478 were ``automatic``). `#473 <https://github.com/pybind/pybind11/pull/473>`_. 1479 1480* Support for ``std::unique_ptr`` with non-default deleters or no deleter at 1481 all (``py::nodelete``). `#384 <https://github.com/pybind/pybind11/pull/384>`_. 1482 1483* Deprecated ``handle::call()`` method. The new syntax to call Python 1484 functions is simply ``handle()``. It can also be invoked explicitly via 1485 ``handle::operator<X>()``, where ``X`` is an optional return value policy. 1486 1487* Print more informative error messages when ``make_tuple()`` or ``cast()`` 1488 fail. `#262 <https://github.com/pybind/pybind11/pull/262>`_. 1489 1490* Creation of holder types for classes deriving from 1491 ``std::enable_shared_from_this<>`` now also works for ``const`` values. 1492 `#260 <https://github.com/pybind/pybind11/pull/260>`_. 1493 1494* ``make_iterator()`` improvements for better compatibility with various 1495 types (now uses prefix increment operator); it now also accepts iterators 1496 with different begin/end types as long as they are equality comparable. 1497 `#247 <https://github.com/pybind/pybind11/pull/247>`_. 1498 1499* ``arg()`` now accepts a wider range of argument types for default values. 1500 `#244 <https://github.com/pybind/pybind11/pull/244>`_. 1501 1502* Support ``keep_alive`` where the nurse object may be ``None``. `#341 1503 <https://github.com/pybind/pybind11/pull/341>`_. 1504 1505* Added constructors for ``str`` and ``bytes`` from zero-terminated char 1506 pointers, and from char pointers and length. Added constructors for ``str`` 1507 from ``bytes`` and for ``bytes`` from ``str``, which will perform UTF-8 1508 decoding/encoding as required. 1509 1510* Many other improvements of library internals without user-visible changes 1511 1512 15131.8.1 (July 12, 2016) 1514---------------------- 1515* Fixed a rare but potentially very severe issue when the garbage collector ran 1516 during pybind11 type creation. 1517 15181.8.0 (June 14, 2016) 1519---------------------- 1520* Redesigned CMake build system which exports a convenient 1521 ``pybind11_add_module`` function to parent projects. 1522* ``std::vector<>`` type bindings analogous to Boost.Python's ``indexing_suite`` 1523* Transparent conversion of sparse and dense Eigen matrices and vectors (``eigen.h``) 1524* Added an ``ExtraFlags`` template argument to the NumPy ``array_t<>`` wrapper 1525 to disable an enforced cast that may lose precision, e.g. to create overloads 1526 for different precisions and complex vs real-valued matrices. 1527* Prevent implicit conversion of floating point values to integral types in 1528 function arguments 1529* Fixed incorrect default return value policy for functions returning a shared 1530 pointer 1531* Don't allow registering a type via ``class_`` twice 1532* Don't allow casting a ``None`` value into a C++ lvalue reference 1533* Fixed a crash in ``enum_::operator==`` that was triggered by the ``help()`` command 1534* Improved detection of whether or not custom C++ types can be copy/move-constructed 1535* Extended ``str`` type to also work with ``bytes`` instances 1536* Added a ``"name"_a`` user defined string literal that is equivalent to ``py::arg("name")``. 1537* When specifying function arguments via ``py::arg``, the test that verifies 1538 the number of arguments now runs at compile time. 1539* Added ``[[noreturn]]`` attribute to ``pybind11_fail()`` to quench some 1540 compiler warnings 1541* List function arguments in exception text when the dispatch code cannot find 1542 a matching overload 1543* Added ``PYBIND11_OVERLOAD_NAME`` and ``PYBIND11_OVERLOAD_PURE_NAME`` macros which 1544 can be used to override virtual methods whose name differs in C++ and Python 1545 (e.g. ``__call__`` and ``operator()``) 1546* Various minor ``iterator`` and ``make_iterator()`` improvements 1547* Transparently support ``__bool__`` on Python 2.x and Python 3.x 1548* Fixed issue with destructor of unpickled object not being called 1549* Minor CMake build system improvements on Windows 1550* New ``pybind11::args`` and ``pybind11::kwargs`` types to create functions which 1551 take an arbitrary number of arguments and keyword arguments 1552* New syntax to call a Python function from C++ using ``*args`` and ``*kwargs`` 1553* The functions ``def_property_*`` now correctly process docstring arguments (these 1554 formerly caused a segmentation fault) 1555* Many ``mkdoc.py`` improvements (enumerations, template arguments, ``DOC()`` 1556 macro accepts more arguments) 1557* Cygwin support 1558* Documentation improvements (pickling support, ``keep_alive``, macro usage) 1559 15601.7 (April 30, 2016) 1561---------------------- 1562* Added a new ``move`` return value policy that triggers C++11 move semantics. 1563 The automatic return value policy falls back to this case whenever a rvalue 1564 reference is encountered 1565* Significantly more general GIL state routines that are used instead of 1566 Python's troublesome ``PyGILState_Ensure`` and ``PyGILState_Release`` API 1567* Redesign of opaque types that drastically simplifies their usage 1568* Extended ability to pass values of type ``[const] void *`` 1569* ``keep_alive`` fix: don't fail when there is no patient 1570* ``functional.h``: acquire the GIL before calling a Python function 1571* Added Python RAII type wrappers ``none`` and ``iterable`` 1572* Added ``*args`` and ``*kwargs`` pass-through parameters to 1573 ``pybind11.get_include()`` function 1574* Iterator improvements and fixes 1575* Documentation on return value policies and opaque types improved 1576 15771.6 (April 30, 2016) 1578---------------------- 1579* Skipped due to upload to PyPI gone wrong and inability to recover 1580 (https://github.com/pypa/packaging-problems/issues/74) 1581 15821.5 (April 21, 2016) 1583---------------------- 1584* For polymorphic types, use RTTI to try to return the closest type registered with pybind11 1585* Pickling support for serializing and unserializing C++ instances to a byte stream in Python 1586* Added a convenience routine ``make_iterator()`` which turns a range indicated 1587 by a pair of C++ iterators into a iterable Python object 1588* Added ``len()`` and a variadic ``make_tuple()`` function 1589* Addressed a rare issue that could confuse the current virtual function 1590 dispatcher and another that could lead to crashes in multi-threaded 1591 applications 1592* Added a ``get_include()`` function to the Python module that returns the path 1593 of the directory containing the installed pybind11 header files 1594* Documentation improvements: import issues, symbol visibility, pickling, limitations 1595* Added casting support for ``std::reference_wrapper<>`` 1596 15971.4 (April 7, 2016) 1598-------------------------- 1599* Transparent type conversion for ``std::wstring`` and ``wchar_t`` 1600* Allow passing ``nullptr``-valued strings 1601* Transparent passing of ``void *`` pointers using capsules 1602* Transparent support for returning values wrapped in ``std::unique_ptr<>`` 1603* Improved docstring generation for compatibility with Sphinx 1604* Nicer debug error message when default parameter construction fails 1605* Support for "opaque" types that bypass the transparent conversion layer for STL containers 1606* Redesigned type casting interface to avoid ambiguities that could occasionally cause compiler errors 1607* Redesigned property implementation; fixes crashes due to an unfortunate default return value policy 1608* Anaconda package generation support 1609 16101.3 (March 8, 2016) 1611-------------------------- 1612 1613* Added support for the Intel C++ compiler (v15+) 1614* Added support for the STL unordered set/map data structures 1615* Added support for the STL linked list data structure 1616* NumPy-style broadcasting support in ``pybind11::vectorize`` 1617* pybind11 now displays more verbose error messages when ``arg::operator=()`` fails 1618* pybind11 internal data structures now live in a version-dependent namespace to avoid ABI issues 1619* Many, many bugfixes involving corner cases and advanced usage 1620 16211.2 (February 7, 2016) 1622-------------------------- 1623 1624* Optional: efficient generation of function signatures at compile time using C++14 1625* Switched to a simpler and more general way of dealing with function default 1626 arguments. Unused keyword arguments in function calls are now detected and 1627 cause errors as expected 1628* New ``keep_alive`` call policy analogous to Boost.Python's ``with_custodian_and_ward`` 1629* New ``pybind11::base<>`` attribute to indicate a subclass relationship 1630* Improved interface for RAII type wrappers in ``pytypes.h`` 1631* Use RAII type wrappers consistently within pybind11 itself. This 1632 fixes various potential refcount leaks when exceptions occur 1633* Added new ``bytes`` RAII type wrapper (maps to ``string`` in Python 2.7) 1634* Made handle and related RAII classes const correct, using them more 1635 consistently everywhere now 1636* Got rid of the ugly ``__pybind11__`` attributes on the Python side---they are 1637 now stored in a C++ hash table that is not visible in Python 1638* Fixed refcount leaks involving NumPy arrays and bound functions 1639* Vastly improved handling of shared/smart pointers 1640* Removed an unnecessary copy operation in ``pybind11::vectorize`` 1641* Fixed naming clashes when both pybind11 and NumPy headers are included 1642* Added conversions for additional exception types 1643* Documentation improvements (using multiple extension modules, smart pointers, 1644 other minor clarifications) 1645* unified infrastructure for parsing variadic arguments in ``class_`` and cpp_function 1646* Fixed license text (was: ZLIB, should have been: 3-clause BSD) 1647* Python 3.2 compatibility 1648* Fixed remaining issues when accessing types in another plugin module 1649* Added enum comparison and casting methods 1650* Improved SFINAE-based detection of whether types are copy-constructible 1651* Eliminated many warnings about unused variables and the use of ``offsetof()`` 1652* Support for ``std::array<>`` conversions 1653 16541.1 (December 7, 2015) 1655-------------------------- 1656 1657* Documentation improvements (GIL, wrapping functions, casting, fixed many typos) 1658* Generalized conversion of integer types 1659* Improved support for casting function objects 1660* Improved support for ``std::shared_ptr<>`` conversions 1661* Initial support for ``std::set<>`` conversions 1662* Fixed type resolution issue for types defined in a separate plugin module 1663* CMake build system improvements 1664* Factored out generic functionality to non-templated code (smaller code size) 1665* Added a code size / compile time benchmark vs Boost.Python 1666* Added an appveyor CI script 1667 16681.0 (October 15, 2015) 1669------------------------ 1670* Initial release 1671