changelog.rst revision 12037:d28054ac6ec9
1955SN/A.. _changelog: 2955SN/A 31762SN/AChangelog 4955SN/A######### 5955SN/A 6955SN/AStarting with version 1.8.0, pybind11 releases use a `semantic versioning 7955SN/A<http://semver.org>`_ policy. 8955SN/A 9955SN/A 10955SN/Av2.1.1 (April 7, 2017) 11955SN/A----------------------------------------------------- 12955SN/A 13955SN/A* Fixed minimum version requirement for MSVC 2015u3 14955SN/A `#773 <https://github.com/pybind/pybind11/pull/773>`_. 15955SN/A 16955SN/Av2.1.0 (March 22, 2017) 17955SN/A----------------------------------------------------- 18955SN/A 19955SN/A* pybind11 now performs function overload resolution in two phases. The first 20955SN/A phase only considers exact type matches, while the second allows for implicit 21955SN/A conversions to take place. A special ``noconvert()`` syntax can be used to 22955SN/A completely disable implicit conversions for specific arguments. 23955SN/A `#643 <https://github.com/pybind/pybind11/pull/643>`_, 24955SN/A `#634 <https://github.com/pybind/pybind11/pull/634>`_, 25955SN/A `#650 <https://github.com/pybind/pybind11/pull/650>`_. 26955SN/A 27955SN/A* Fixed a regression where static properties no longer worked with classes 282665Ssaidi@eecs.umich.edu using multiple inheritance. The ``py::metaclass`` attribute is no longer 294762Snate@binkert.org necessary (and deprecated as of this release) when binding classes with 30955SN/A static properties. 315522Snate@binkert.org `#679 <https://github.com/pybind/pybind11/pull/679>`_, 326143Snate@binkert.org 334762Snate@binkert.org* Classes bound using ``pybind11`` can now use custom metaclasses. 345522Snate@binkert.org `#679 <https://github.com/pybind/pybind11/pull/679>`_, 35955SN/A 365522Snate@binkert.org* ``py::args`` and ``py::kwargs`` can now be mixed with other positional 37955SN/A arguments when binding functions using pybind11. 385522Snate@binkert.org `#611 <https://github.com/pybind/pybind11/pull/611>`_. 394202Sbinkertn@umich.edu 405742Snate@binkert.org* Improved support for C++11 unicode string and character types; added 41955SN/A extensive documentation regarding pybind11's string conversion behavior. 424381Sbinkertn@umich.edu `#624 <https://github.com/pybind/pybind11/pull/624>`_, 434381Sbinkertn@umich.edu `#636 <https://github.com/pybind/pybind11/pull/636>`_, 44955SN/A `#715 <https://github.com/pybind/pybind11/pull/715>`_. 45955SN/A 46955SN/A* pybind11 can now avoid expensive copies when converting Eigen arrays to NumPy 474202Sbinkertn@umich.edu arrays (and vice versa). `#610 <https://github.com/pybind/pybind11/pull/610>`_. 48955SN/A 494382Sbinkertn@umich.edu* The "fast path" in ``py::vectorize`` now works for any full-size group of C or 504382Sbinkertn@umich.edu F-contiguous arrays. The non-fast path is also faster since it no longer performs 514382Sbinkertn@umich.edu copies of the input arguments (except when type conversions are necessary). 526108Snate@binkert.org `#610 <https://github.com/pybind/pybind11/pull/610>`_. 535517Snate@binkert.org 546143Snate@binkert.org* Added fast, unchecked access to NumPy arrays via a proxy object. 556143Snate@binkert.org `#746 <https://github.com/pybind/pybind11/pull/746>`_. 566143Snate@binkert.org 576143Snate@binkert.org* Transparent support for class-specific ``operator new`` and 586143Snate@binkert.org ``operator delete`` implementations. 596143Snate@binkert.org `#755 <https://github.com/pybind/pybind11/pull/755>`_. 606143Snate@binkert.org 616143Snate@binkert.org* Slimmer and more efficient STL-compatible iterator interface for sequence types. 626143Snate@binkert.org `#662 <https://github.com/pybind/pybind11/pull/662>`_. 636143Snate@binkert.org 646143Snate@binkert.org* Improved custom holder type support. 656143Snate@binkert.org `#607 <https://github.com/pybind/pybind11/pull/607>`_. 666143Snate@binkert.org 676143Snate@binkert.org* ``nullptr`` to ``None`` conversion fixed in various builtin type casters. 686143Snate@binkert.org `#732 <https://github.com/pybind/pybind11/pull/732>`_. 694762Snate@binkert.org 706143Snate@binkert.org* ``enum_`` now exposes its members via a special ``__members__`` attribute. 716143Snate@binkert.org `#666 <https://github.com/pybind/pybind11/pull/666>`_. 726143Snate@binkert.org 736143Snate@binkert.org* ``std::vector`` bindings created using ``stl_bind.h`` can now optionally 746143Snate@binkert.org implement the buffer protocol. `#488 <https://github.com/pybind/pybind11/pull/488>`_. 756143Snate@binkert.org 766143Snate@binkert.org* Automated C++ reference documentation using doxygen and breathe. 776143Snate@binkert.org `#598 <https://github.com/pybind/pybind11/pull/598>`_. 786143Snate@binkert.org 796143Snate@binkert.org* Added minimum compiler version assertions. 806143Snate@binkert.org `#727 <https://github.com/pybind/pybind11/pull/727>`_. 816143Snate@binkert.org 826143Snate@binkert.org* Improved compatibility with C++1z. 836143Snate@binkert.org `#677 <https://github.com/pybind/pybind11/pull/677>`_. 846143Snate@binkert.org 856143Snate@binkert.org* Improved ``py::capsule`` API. Can be used to implement cleanup 866143Snate@binkert.org callbacks that are involved at module destruction time. 876143Snate@binkert.org `#752 <https://github.com/pybind/pybind11/pull/752>`_. 886143Snate@binkert.org 896143Snate@binkert.org* Various minor improvements and fixes. 906143Snate@binkert.org `#595 <https://github.com/pybind/pybind11/pull/595>`_, 916143Snate@binkert.org `#588 <https://github.com/pybind/pybind11/pull/588>`_, 926143Snate@binkert.org `#589 <https://github.com/pybind/pybind11/pull/589>`_, 936143Snate@binkert.org `#603 <https://github.com/pybind/pybind11/pull/603>`_, 946143Snate@binkert.org `#619 <https://github.com/pybind/pybind11/pull/619>`_, 956143Snate@binkert.org `#648 <https://github.com/pybind/pybind11/pull/648>`_, 966143Snate@binkert.org `#695 <https://github.com/pybind/pybind11/pull/695>`_, 976143Snate@binkert.org `#720 <https://github.com/pybind/pybind11/pull/720>`_, 986143Snate@binkert.org `#723 <https://github.com/pybind/pybind11/pull/723>`_, 996143Snate@binkert.org `#729 <https://github.com/pybind/pybind11/pull/729>`_, 1006143Snate@binkert.org `#724 <https://github.com/pybind/pybind11/pull/724>`_, 1016143Snate@binkert.org `#742 <https://github.com/pybind/pybind11/pull/742>`_, 1026143Snate@binkert.org `#753 <https://github.com/pybind/pybind11/pull/753>`_. 1036143Snate@binkert.org 1046143Snate@binkert.orgv2.0.1 (Jan 4, 2017) 1056143Snate@binkert.org----------------------------------------------------- 1066143Snate@binkert.org 1076143Snate@binkert.org* Fix pointer to reference error in type_caster on MSVC 1086143Snate@binkert.org `#583 <https://github.com/pybind/pybind11/pull/583>`_. 1096143Snate@binkert.org 1106143Snate@binkert.org* Fixed a segmentation in the test suite due to a typo 1116143Snate@binkert.org `cd7eac <https://github.com/pybind/pybind11/commit/cd7eac>`_. 1126143Snate@binkert.org 1135522Snate@binkert.orgv2.0.0 (Jan 1, 2017) 1146143Snate@binkert.org----------------------------------------------------- 1156143Snate@binkert.org 1166143Snate@binkert.org* Fixed a reference counting regression affecting types with custom metaclasses 1176143Snate@binkert.org (introduced in v2.0.0-rc1). 1186143Snate@binkert.org `#571 <https://github.com/pybind/pybind11/pull/571>`_. 1196143Snate@binkert.org 1206143Snate@binkert.org* Quenched a CMake policy warning. 1216143Snate@binkert.org `#570 <https://github.com/pybind/pybind11/pull/570>`_. 1226143Snate@binkert.org 1236143Snate@binkert.orgv2.0.0-rc1 (Dec 23, 2016) 1245522Snate@binkert.org----------------------------------------------------- 1255522Snate@binkert.org 1265522Snate@binkert.orgThe pybind11 developers are excited to issue a release candidate of pybind11 1275522Snate@binkert.orgwith a subsequent v2.0.0 release planned in early January next year. 1285604Snate@binkert.org 1295604Snate@binkert.orgAn incredible amount of effort by went into pybind11 over the last ~5 months, 1306143Snate@binkert.orgleading to a release that is jam-packed with exciting new features and numerous 1316143Snate@binkert.orgusability improvements. The following list links PRs or individual commits 1324762Snate@binkert.orgwhenever applicable. 1334762Snate@binkert.org 1346143Snate@binkert.orgHappy Christmas! 1356143Snate@binkert.org 1366143Snate@binkert.org* Support for binding C++ class hierarchies that make use of multiple 1376143Snate@binkert.org inheritance. `#410 <https://github.com/pybind/pybind11/pull/410>`_. 1384762Snate@binkert.org 1396143Snate@binkert.org* PyPy support: pybind11 now supports nightly builds of PyPy and will 1406143Snate@binkert.org interoperate with the future 5.7 release. No code changes are necessary, 1416143Snate@binkert.org everything "just" works as usual. Note that we only target the Python 2.7 1426143Snate@binkert.org branch for now; support for 3.x will be added once its ``cpyext`` extension 1436143Snate@binkert.org support catches up. A few minor features remain unsupported for the time 1446143Snate@binkert.org being (notably dynamic attributes in custom types). 1456143Snate@binkert.org `#527 <https://github.com/pybind/pybind11/pull/527>`_. 1466143Snate@binkert.org 1475604Snate@binkert.org* Significant work on the documentation -- in particular, the monolitic 1486143Snate@binkert.org ``advanced.rst`` file was restructured into a easier to read hierarchical 1496143Snate@binkert.org organization. `#448 <https://github.com/pybind/pybind11/pull/448>`_. 1506143Snate@binkert.org 1514762Snate@binkert.org* Many NumPy-related improvements: 1526143Snate@binkert.org 1534762Snate@binkert.org 1. Object-oriented API to access and modify NumPy ``ndarray`` instances, 1544762Snate@binkert.org replicating much of the corresponding NumPy C API functionality. 1554762Snate@binkert.org `#402 <https://github.com/pybind/pybind11/pull/402>`_. 1566143Snate@binkert.org 1576143Snate@binkert.org 2. NumPy array ``dtype`` array descriptors are now first-class citizens and 1584762Snate@binkert.org are exposed via a new class ``py::dtype``. 1596143Snate@binkert.org 1606143Snate@binkert.org 3. Structured dtypes can be registered using the ``PYBIND11_NUMPY_DTYPE()`` 1616143Snate@binkert.org macro. Special ``array`` constructors accepting dtype objects were also 1626143Snate@binkert.org added. 1634762Snate@binkert.org 1646143Snate@binkert.org One potential caveat involving this change: format descriptor strings 1654762Snate@binkert.org should now be accessed via ``format_descriptor::format()`` (however, for 1666143Snate@binkert.org compatibility purposes, the old syntax ``format_descriptor::value`` will 1674762Snate@binkert.org still work for non-structured data types). `#308 1686143Snate@binkert.org <https://github.com/pybind/pybind11/pull/308>`_. 1696143Snate@binkert.org 1706143Snate@binkert.org 4. Further improvements to support structured dtypes throughout the system. 1716143Snate@binkert.org `#472 <https://github.com/pybind/pybind11/pull/472>`_, 1726143Snate@binkert.org `#474 <https://github.com/pybind/pybind11/pull/474>`_, 1736143Snate@binkert.org `#459 <https://github.com/pybind/pybind11/pull/459>`_, 1746143Snate@binkert.org `#453 <https://github.com/pybind/pybind11/pull/453>`_, 1756143Snate@binkert.org `#452 <https://github.com/pybind/pybind11/pull/452>`_, and 1766143Snate@binkert.org `#505 <https://github.com/pybind/pybind11/pull/505>`_. 1776143Snate@binkert.org 1786143Snate@binkert.org 5. Fast access operators. `#497 <https://github.com/pybind/pybind11/pull/497>`_. 1796143Snate@binkert.org 1806143Snate@binkert.org 6. Constructors for arrays whose storage is owned by another object. 181955SN/A `#440 <https://github.com/pybind/pybind11/pull/440>`_. 1825584Snate@binkert.org 1835584Snate@binkert.org 7. Added constructors for ``array`` and ``array_t`` explicitly accepting shape 1845584Snate@binkert.org and strides; if strides are not provided, they are deduced assuming 1855584Snate@binkert.org C-contiguity. Also added simplified constructors for 1-dimensional case. 1866143Snate@binkert.org 1876143Snate@binkert.org 8. Added buffer/NumPy support for ``char[N]`` and ``std::array<char, N>`` types. 1886143Snate@binkert.org 1895584Snate@binkert.org 9. Added ``memoryview`` wrapper type which is constructible from ``buffer_info``. 1904382Sbinkertn@umich.edu 1914202Sbinkertn@umich.edu* Eigen: many additional conversions and support for non-contiguous 1924382Sbinkertn@umich.edu arrays/slices. 1934382Sbinkertn@umich.edu `#427 <https://github.com/pybind/pybind11/pull/427>`_, 1944382Sbinkertn@umich.edu `#315 <https://github.com/pybind/pybind11/pull/315>`_, 1955584Snate@binkert.org `#316 <https://github.com/pybind/pybind11/pull/316>`_, 1964382Sbinkertn@umich.edu `#312 <https://github.com/pybind/pybind11/pull/312>`_, and 1974382Sbinkertn@umich.edu `#267 <https://github.com/pybind/pybind11/pull/267>`_ 1984382Sbinkertn@umich.edu 1995192Ssaidi@eecs.umich.edu* Incompatible changes in ``class_<...>::class_()``: 2005192Ssaidi@eecs.umich.edu 2015799Snate@binkert.org 1. Declarations of types that provide access via the buffer protocol must 2025799Snate@binkert.org now include the ``py::buffer_protocol()`` annotation as an argument to 2035799Snate@binkert.org the ``class_`` constructor. 2045192Ssaidi@eecs.umich.edu 2055799Snate@binkert.org 2. Declarations of types that require a custom metaclass (i.e. all classes 2065192Ssaidi@eecs.umich.edu which include static properties via commands such as 2075799Snate@binkert.org ``def_readwrite_static()``) must now include the ``py::metaclass()`` 2085799Snate@binkert.org annotation as an argument to the ``class_`` constructor. 2095192Ssaidi@eecs.umich.edu 2105192Ssaidi@eecs.umich.edu These two changes were necessary to make type definitions in pybind11 2115192Ssaidi@eecs.umich.edu future-proof, and to support PyPy via its cpyext mechanism. `#527 2125799Snate@binkert.org <https://github.com/pybind/pybind11/pull/527>`_. 2135192Ssaidi@eecs.umich.edu 2145192Ssaidi@eecs.umich.edu 2155192Ssaidi@eecs.umich.edu 3. This version of pybind11 uses a redesigned mechnism for instantiating 2165192Ssaidi@eecs.umich.edu trempoline classes that are used to override virtual methods from within 2175192Ssaidi@eecs.umich.edu Python. This led to the following user-visible syntax change: instead of 2185192Ssaidi@eecs.umich.edu 2194382Sbinkertn@umich.edu .. code-block:: cpp 2204382Sbinkertn@umich.edu 2214382Sbinkertn@umich.edu py::class_<TrampolineClass>("MyClass") 2222667Sstever@eecs.umich.edu .alias<MyClass>() 2232667Sstever@eecs.umich.edu .... 2242667Sstever@eecs.umich.edu 2252667Sstever@eecs.umich.edu write 2262667Sstever@eecs.umich.edu 2272667Sstever@eecs.umich.edu .. code-block:: cpp 2285742Snate@binkert.org 2295742Snate@binkert.org py::class_<MyClass, TrampolineClass>("MyClass") 2305742Snate@binkert.org .... 2312037SN/A 2322037SN/A Importantly, both the original and the trampoline class are now 2332037SN/A specified as an arguments (in arbitrary order) to the ``py::class_`` 2345793Snate@binkert.org template, and the ``alias<..>()`` call is gone. The new scheme has zero 2355793Snate@binkert.org overhead in cases when Python doesn't override any functions of the 2365793Snate@binkert.org underlying C++ class. `rev. 86d825 2375793Snate@binkert.org <https://github.com/pybind/pybind11/commit/86d825>`_. 2385793Snate@binkert.org 2394382Sbinkertn@umich.edu* Added ``eval`` and ``eval_file`` functions for evaluating expressions and 2404762Snate@binkert.org statements from a string or file. `rev. 0d3fc3 2415344Sstever@gmail.com <https://github.com/pybind/pybind11/commit/0d3fc3>`_. 2424382Sbinkertn@umich.edu 2435341Sstever@gmail.com* pybind11 can now create types with a modifiable dictionary. 2445742Snate@binkert.org `#437 <https://github.com/pybind/pybind11/pull/437>`_ and 2455742Snate@binkert.org `#444 <https://github.com/pybind/pybind11/pull/444>`_. 2465742Snate@binkert.org 2475742Snate@binkert.org* Support for translation of arbitrary C++ exceptions to Python counterparts. 2485742Snate@binkert.org `#296 <https://github.com/pybind/pybind11/pull/296>`_ and 2494762Snate@binkert.org `#273 <https://github.com/pybind/pybind11/pull/273>`_. 2505742Snate@binkert.org 2515742Snate@binkert.org* Report full backtraces through mixed C++/Python code, better reporting for 2525742Snate@binkert.org import errors, fixed GIL management in exception processing. 2535742Snate@binkert.org `#537 <https://github.com/pybind/pybind11/pull/537>`_, 2545742Snate@binkert.org `#494 <https://github.com/pybind/pybind11/pull/494>`_, 2555742Snate@binkert.org `rev. e72d95 <https://github.com/pybind/pybind11/commit/e72d95>`_, and 2565742Snate@binkert.org `rev. 099d6e <https://github.com/pybind/pybind11/commit/099d6e>`_. 2575341Sstever@gmail.com 2585742Snate@binkert.org* Support for bit-level operations, comparisons, and serialization of C++ 2595341Sstever@gmail.com enumerations. `#503 <https://github.com/pybind/pybind11/pull/503>`_, 2604773Snate@binkert.org `#508 <https://github.com/pybind/pybind11/pull/508>`_, 2616108Snate@binkert.org `#380 <https://github.com/pybind/pybind11/pull/380>`_, 2621858SN/A `#309 <https://github.com/pybind/pybind11/pull/309>`_. 2631085SN/A `#311 <https://github.com/pybind/pybind11/pull/311>`_. 2644382Sbinkertn@umich.edu 2654382Sbinkertn@umich.edu* The ``class_`` constructor now accepts its template arguments in any order. 2664762Snate@binkert.org `#385 <https://github.com/pybind/pybind11/pull/385>`_. 2674762Snate@binkert.org 2684762Snate@binkert.org* Attribute and item accessors now have a more complete interface which makes 2695517Snate@binkert.org it possible to chain attributes as in 2705517Snate@binkert.org ``obj.attr("a")[key].attr("b").attr("method")(1, 2, 3)``. `#425 2715517Snate@binkert.org <https://github.com/pybind/pybind11/pull/425>`_. 2725517Snate@binkert.org 2735517Snate@binkert.org* Major redesign of the default and conversion constructors in ``pytypes.h``. 2745517Snate@binkert.org `#464 <https://github.com/pybind/pybind11/pull/464>`_. 2755517Snate@binkert.org 2765517Snate@binkert.org* Added built-in support for ``std::shared_ptr`` holder type. It is no longer 2775517Snate@binkert.org necessary to to include a declaration of the form 2785517Snate@binkert.org ``PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`` (though continuing to 2795517Snate@binkert.org do so won't cause an error). 2805517Snate@binkert.org `#454 <https://github.com/pybind/pybind11/pull/454>`_. 2815517Snate@binkert.org 2825517Snate@binkert.org* New ``py::overload_cast`` casting operator to select among multiple possible 2835517Snate@binkert.org overloads of a function. An example: 2845517Snate@binkert.org 2855517Snate@binkert.org .. code-block:: cpp 2865798Snate@binkert.org 2875517Snate@binkert.org py::class_<Pet>(m, "Pet") 2885517Snate@binkert.org .def("set", py::overload_cast<int>(&Pet::set), "Set the pet's age") 2895517Snate@binkert.org .def("set", py::overload_cast<const std::string &>(&Pet::set), "Set the pet's name"); 2905517Snate@binkert.org 2915517Snate@binkert.org This feature only works on C++14-capable compilers. 2925517Snate@binkert.org `#541 <https://github.com/pybind/pybind11/pull/541>`_. 2935517Snate@binkert.org 2945517Snate@binkert.org* C++ types are automatically cast to Python types, e.g. when assigning 2956143Snate@binkert.org them as an attribute. For instance, the following is now legal: 2966143Snate@binkert.org 2975517Snate@binkert.org .. code-block:: cpp 2985517Snate@binkert.org 2995517Snate@binkert.org py::module m = /* ... */ 3005517Snate@binkert.org m.attr("constant") = 123; 3015517Snate@binkert.org 3025517Snate@binkert.org (Previously, a ``py::cast`` call was necessary to avoid a compilation error.) 3035517Snate@binkert.org `#551 <https://github.com/pybind/pybind11/pull/551>`_. 3045517Snate@binkert.org 3055517Snate@binkert.org* Redesigned ``pytest``-based test suite. `#321 <https://github.com/pybind/pybind11/pull/321>`_. 3065517Snate@binkert.org 3075517Snate@binkert.org* Instance tracking to detect reference leaks in test suite. `#324 <https://github.com/pybind/pybind11/pull/324>`_ 3085517Snate@binkert.org 3095517Snate@binkert.org* pybind11 can now distinguish between multiple different instances that are 3105517Snate@binkert.org located at the same memory address, but which have different types. 3115798Snate@binkert.org `#329 <https://github.com/pybind/pybind11/pull/329>`_. 3125798Snate@binkert.org 3135517Snate@binkert.org* Improved logic in ``move`` return value policy. 3145517Snate@binkert.org `#510 <https://github.com/pybind/pybind11/pull/510>`_, 3156143Snate@binkert.org `#297 <https://github.com/pybind/pybind11/pull/297>`_. 3166143Snate@binkert.org 3176143Snate@binkert.org* Generalized unpacking API to permit calling Python functions from C++ using 3186143Snate@binkert.org notation such as ``foo(a1, a2, *args, "ka"_a=1, "kb"_a=2, **kwargs)``. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 3195517Snate@binkert.org 3206143Snate@binkert.org* ``py::print()`` function whose behavior matches that of the native Python 3215517Snate@binkert.org ``print()`` function. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 3225517Snate@binkert.org 3235517Snate@binkert.org* Added ``py::dict`` keyword constructor:``auto d = dict("number"_a=42, 3245517Snate@binkert.org "name"_a="World");``. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 3255517Snate@binkert.org 3265517Snate@binkert.org* Added ``py::str::format()`` method and ``_s`` literal: ``py::str s = "1 + 2 3276143Snate@binkert.org = {}"_s.format(3);``. `#372 <https://github.com/pybind/pybind11/pull/372>`_. 3286143Snate@binkert.org 3295517Snate@binkert.org* Added ``py::repr()`` function which is equivalent to Python's builtin 3304762Snate@binkert.org ``repr()``. `#333 <https://github.com/pybind/pybind11/pull/333>`_. 3315517Snate@binkert.org 3324762Snate@binkert.org* Improved construction and destruction logic for holder types. It is now 3335517Snate@binkert.org possible to reference instances with smart pointer holder types without 3345517Snate@binkert.org constructing the holder if desired. The ``PYBIND11_DECLARE_HOLDER_TYPE`` 3356143Snate@binkert.org macro now accepts an optional second parameter to indicate whether the holder 3366143Snate@binkert.org type uses intrusive reference counting. 3375517Snate@binkert.org `#533 <https://github.com/pybind/pybind11/pull/533>`_ and 3385517Snate@binkert.org `#561 <https://github.com/pybind/pybind11/pull/561>`_. 3395517Snate@binkert.org 3405517Snate@binkert.org* Mapping a stateless C++ function to Python and back is now "for free" (i.e. 3415517Snate@binkert.org no extra indirections or argument conversion overheads). `rev. 954b79 3425517Snate@binkert.org <https://github.com/pybind/pybind11/commit/954b79>`_. 3435517Snate@binkert.org 3445517Snate@binkert.org* Bindings for ``std::valarray<T>``. 3455517Snate@binkert.org `#545 <https://github.com/pybind/pybind11/pull/545>`_. 3465517Snate@binkert.org 3476143Snate@binkert.org* Improved support for C++17 capable compilers. 3485517Snate@binkert.org `#562 <https://github.com/pybind/pybind11/pull/562>`_. 3495517Snate@binkert.org 3505517Snate@binkert.org* Bindings for ``std::optional<t>``. 3515517Snate@binkert.org `#475 <https://github.com/pybind/pybind11/pull/475>`_, 3525517Snate@binkert.org `#476 <https://github.com/pybind/pybind11/pull/476>`_, 3535517Snate@binkert.org `#479 <https://github.com/pybind/pybind11/pull/479>`_, 3544762Snate@binkert.org `#499 <https://github.com/pybind/pybind11/pull/499>`_, and 3554762Snate@binkert.org `#501 <https://github.com/pybind/pybind11/pull/501>`_. 3564762Snate@binkert.org 3574762Snate@binkert.org* ``stl_bind.h``: general improvements and support for ``std::map`` and 3584762Snate@binkert.org ``std::unordered_map``. 3594762Snate@binkert.org `#490 <https://github.com/pybind/pybind11/pull/490>`_, 3606143Snate@binkert.org `#282 <https://github.com/pybind/pybind11/pull/282>`_, 3614762Snate@binkert.org `#235 <https://github.com/pybind/pybind11/pull/235>`_. 3624762Snate@binkert.org 3634762Snate@binkert.org* The ``std::tuple``, ``std::pair``, ``std::list``, and ``std::vector`` type 3644762Snate@binkert.org casters now accept any Python sequence type as input. `rev. 107285 3654382Sbinkertn@umich.edu <https://github.com/pybind/pybind11/commit/107285>`_. 3664382Sbinkertn@umich.edu 3675517Snate@binkert.org* Improved CMake Python detection on multi-architecture Linux. 3685517Snate@binkert.org `#532 <https://github.com/pybind/pybind11/pull/532>`_. 3695517Snate@binkert.org 3705517Snate@binkert.org* Infrastructure to selectively disable or enable parts of the automatically 3715798Snate@binkert.org generated docstrings. `#486 <https://github.com/pybind/pybind11/pull/486>`_. 3725798Snate@binkert.org 3735824Ssaidi@eecs.umich.edu* ``reference`` and ``reference_internal`` are now the default return value 3745517Snate@binkert.org properties for static and non-static properties, respectively. `#473 3755517Snate@binkert.org <https://github.com/pybind/pybind11/pull/473>`_. (the previous defaults 3765863Snate@binkert.org were ``automatic``). `#473 <https://github.com/pybind/pybind11/pull/473>`_. 3775798Snate@binkert.org 3785798Snate@binkert.org* Support for ``std::unique_ptr`` with non-default deleters or no deleter at 3795798Snate@binkert.org all (``py::nodelete``). `#384 <https://github.com/pybind/pybind11/pull/384>`_. 3805798Snate@binkert.org 3815517Snate@binkert.org* Deprecated ``handle::call()`` method. The new syntax to call Python 3825517Snate@binkert.org functions is simply ``handle()``. It can also be invoked explicitly via 3835517Snate@binkert.org ``handle::operator<X>()``, where ``X`` is an optional return value policy. 3845517Snate@binkert.org 3855517Snate@binkert.org* Print more informative error messages when ``make_tuple()`` or ``cast()`` 3865517Snate@binkert.org fail. `#262 <https://github.com/pybind/pybind11/pull/262>`_. 3875517Snate@binkert.org 3885517Snate@binkert.org* Creation of holder types for classes deriving from 3895798Snate@binkert.org ``std::enable_shared_from_this<>`` now also works for ``const`` values. 3905798Snate@binkert.org `#260 <https://github.com/pybind/pybind11/pull/260>`_. 3915798Snate@binkert.org 3925798Snate@binkert.org* ``make_iterator()`` improvements for better compatibility with various 3935798Snate@binkert.org types (now uses prefix increment operator); it now also accepts iterators 3945798Snate@binkert.org with different begin/end types as long as they are equality comparable. 3955517Snate@binkert.org `#247 <https://github.com/pybind/pybind11/pull/247>`_. 3965517Snate@binkert.org 3975517Snate@binkert.org* ``arg()`` now accepts a wider range of argument types for default values. 3985517Snate@binkert.org `#244 <https://github.com/pybind/pybind11/pull/244>`_. 3995517Snate@binkert.org 4005517Snate@binkert.org* Support ``keep_alive`` where the nurse object may be ``None``. `#341 4015517Snate@binkert.org <https://github.com/pybind/pybind11/pull/341>`_. 4025517Snate@binkert.org 4035517Snate@binkert.org* Added constructors for ``str`` and ``bytes`` from zero-terminated char 4044762Snate@binkert.org pointers, and from char pointers and length. Added constructors for ``str`` 4054382Sbinkertn@umich.edu from ``bytes`` and for ``bytes`` from ``str``, which will perform UTF-8 4066143Snate@binkert.org decoding/encoding as required. 4075517Snate@binkert.org 4084382Sbinkertn@umich.edu* Many other improvements of library internals without user-visible changes 4094382Sbinkertn@umich.edu 4104762Snate@binkert.org 4114762Snate@binkert.org1.8.1 (July 12, 2016) 4124762Snate@binkert.org---------------------- 4134762Snate@binkert.org* Fixed a rare but potentially very severe issue when the garbage collector ran 4144762Snate@binkert.org during pybind11 type creation. 4155517Snate@binkert.org 4165517Snate@binkert.org1.8.0 (June 14, 2016) 4175517Snate@binkert.org---------------------- 4185517Snate@binkert.org* Redesigned CMake build system which exports a convenient 4195517Snate@binkert.org ``pybind11_add_module`` function to parent projects. 4205517Snate@binkert.org* ``std::vector<>`` type bindings analogous to Boost.Python's ``indexing_suite`` 4215517Snate@binkert.org* Transparent conversion of sparse and dense Eigen matrices and vectors (``eigen.h``) 4225517Snate@binkert.org* Added an ``ExtraFlags`` template argument to the NumPy ``array_t<>`` wrapper 4236143Snate@binkert.org to disable an enforced cast that may lose precision, e.g. to create overloads 4245517Snate@binkert.org for different precisions and complex vs real-valued matrices. 4255517Snate@binkert.org* Prevent implicit conversion of floating point values to integral types in 4265517Snate@binkert.org function arguments 4275517Snate@binkert.org* Fixed incorrect default return value policy for functions returning a shared 4285517Snate@binkert.org pointer 4295517Snate@binkert.org* Don't allow registering a type via ``class_`` twice 4305517Snate@binkert.org* Don't allow casting a ``None`` value into a C++ lvalue reference 4315517Snate@binkert.org* Fixed a crash in ``enum_::operator==`` that was triggered by the ``help()`` command 4325517Snate@binkert.org* Improved detection of whether or not custom C++ types can be copy/move-constructed 4335517Snate@binkert.org* Extended ``str`` type to also work with ``bytes`` instances 4346143Snate@binkert.org* Added a ``"name"_a`` user defined string literal that is equivalent to ``py::arg("name")``. 4355517Snate@binkert.org* When specifying function arguments via ``py::arg``, the test that verifies 4365517Snate@binkert.org the number of arguments now runs at compile time. 4375517Snate@binkert.org* Added ``[[noreturn]]`` attribute to ``pybind11_fail()`` to quench some 4385517Snate@binkert.org compiler warnings 4395517Snate@binkert.org* List function arguments in exception text when the dispatch code cannot find 4405517Snate@binkert.org a matching overload 4415517Snate@binkert.org* Added ``PYBIND11_OVERLOAD_NAME`` and ``PYBIND11_OVERLOAD_PURE_NAME`` macros which 4425517Snate@binkert.org can be used to override virtual methods whose name differs in C++ and Python 4435517Snate@binkert.org (e.g. ``__call__`` and ``operator()``) 4445517Snate@binkert.org* Various minor ``iterator`` and ``make_iterator()`` improvements 4455517Snate@binkert.org* Transparently support ``__bool__`` on Python 2.x and Python 3.x 4465517Snate@binkert.org* Fixed issue with destructor of unpickled object not being called 4475517Snate@binkert.org* Minor CMake build system improvements on Windows 4485517Snate@binkert.org* New ``pybind11::args`` and ``pybind11::kwargs`` types to create functions which 4495517Snate@binkert.org take an arbitrary number of arguments and keyword arguments 4505517Snate@binkert.org* New syntax to call a Python function from C++ using ``*args`` and ``*kwargs`` 4515517Snate@binkert.org* The functions ``def_property_*`` now correctly process docstring arguments (these 4525517Snate@binkert.org formerly caused a segmentation fault) 4535517Snate@binkert.org* Many ``mkdoc.py`` improvements (enumerations, template arguments, ``DOC()`` 4546143Snate@binkert.org macro accepts more arguments) 4555517Snate@binkert.org* Cygwin support 4564762Snate@binkert.org* Documentation improvements (pickling support, ``keep_alive``, macro usage) 4574762Snate@binkert.org 4586143Snate@binkert.org1.7 (April 30, 2016) 4596143Snate@binkert.org---------------------- 4606143Snate@binkert.org* Added a new ``move`` return value policy that triggers C++11 move semantics. 4614762Snate@binkert.org The automatic return value policy falls back to this case whenever a rvalue 4624762Snate@binkert.org reference is encountered 4634762Snate@binkert.org* Significantly more general GIL state routines that are used instead of 4645517Snate@binkert.org Python's troublesome ``PyGILState_Ensure`` and ``PyGILState_Release`` API 4654762Snate@binkert.org* Redesign of opaque types that drastically simplifies their usage 4664762Snate@binkert.org* Extended ability to pass values of type ``[const] void *`` 4674762Snate@binkert.org* ``keep_alive`` fix: don't fail when there is no patient 4685463Snate@binkert.org* ``functional.h``: acquire the GIL before calling a Python function 4695517Snate@binkert.org* Added Python RAII type wrappers ``none`` and ``iterable`` 4704762Snate@binkert.org* Added ``*args`` and ``*kwargs`` pass-through parameters to 4714762Snate@binkert.org ``pybind11.get_include()`` function 4724762Snate@binkert.org* Iterator improvements and fixes 4734762Snate@binkert.org* Documentation on return value policies and opaque types improved 4744762Snate@binkert.org 4754762Snate@binkert.org1.6 (April 30, 2016) 4765463Snate@binkert.org---------------------- 4775517Snate@binkert.org* Skipped due to upload to PyPI gone wrong and inability to recover 4784762Snate@binkert.org (https://github.com/pypa/packaging-problems/issues/74) 4794762Snate@binkert.org 4804762Snate@binkert.org1.5 (April 21, 2016) 4816143Snate@binkert.org---------------------- 4826143Snate@binkert.org* For polymorphic types, use RTTI to try to return the closest type registered with pybind11 4836143Snate@binkert.org* Pickling support for serializing and unserializing C++ instances to a byte stream in Python 4844762Snate@binkert.org* Added a convenience routine ``make_iterator()`` which turns a range indicated 4854762Snate@binkert.org by a pair of C++ iterators into a iterable Python object 4865517Snate@binkert.org* Added ``len()`` and a variadic ``make_tuple()`` function 4874762Snate@binkert.org* Addressed a rare issue that could confuse the current virtual function 4884762Snate@binkert.org dispatcher and another that could lead to crashes in multi-threaded 4894762Snate@binkert.org applications 4904762Snate@binkert.org* Added a ``get_include()`` function to the Python module that returns the path 4915517Snate@binkert.org of the directory containing the installed pybind11 header files 4924762Snate@binkert.org* Documentation improvements: import issues, symbol visibility, pickling, limitations 4934762Snate@binkert.org* Added casting support for ``std::reference_wrapper<>`` 4944762Snate@binkert.org 4954762Snate@binkert.org1.4 (April 7, 2016) 4965517Snate@binkert.org-------------------------- 4975517Snate@binkert.org* Transparent type conversion for ``std::wstring`` and ``wchar_t`` 4985517Snate@binkert.org* Allow passing ``nullptr``-valued strings 4995517Snate@binkert.org* Transparent passing of ``void *`` pointers using capsules 5005517Snate@binkert.org* Transparent support for returning values wrapped in ``std::unique_ptr<>`` 5015517Snate@binkert.org* Improved docstring generation for compatibility with Sphinx 5025517Snate@binkert.org* Nicer debug error message when default parameter construction fails 5035517Snate@binkert.org* Support for "opaque" types that bypass the transparent conversion layer for STL containers 5045517Snate@binkert.org* Redesigned type casting interface to avoid ambiguities that could occasionally cause compiler errors 5055517Snate@binkert.org* Redesigned property implementation; fixes crashes due to an unfortunate default return value policy 5065517Snate@binkert.org* Anaconda package generation support 5075517Snate@binkert.org 5085517Snate@binkert.org1.3 (March 8, 2016) 5095517Snate@binkert.org-------------------------- 5105517Snate@binkert.org 5115517Snate@binkert.org* Added support for the Intel C++ compiler (v15+) 5125517Snate@binkert.org* Added support for the STL unordered set/map data structures 5135517Snate@binkert.org* Added support for the STL linked list data structure 5145517Snate@binkert.org* NumPy-style broadcasting support in ``pybind11::vectorize`` 5155517Snate@binkert.org* pybind11 now displays more verbose error messages when ``arg::operator=()`` fails 5165517Snate@binkert.org* pybind11 internal data structures now live in a version-dependent namespace to avoid ABI issues 5175517Snate@binkert.org* Many, many bugfixes involving corner cases and advanced usage 5185517Snate@binkert.org 5195517Snate@binkert.org1.2 (February 7, 2016) 5205517Snate@binkert.org-------------------------- 5215517Snate@binkert.org 5225517Snate@binkert.org* Optional: efficient generation of function signatures at compile time using C++14 5235517Snate@binkert.org* Switched to a simpler and more general way of dealing with function default 5245517Snate@binkert.org arguments. Unused keyword arguments in function calls are now detected and 5255517Snate@binkert.org cause errors as expected 5265517Snate@binkert.org* New ``keep_alive`` call policy analogous to Boost.Python's ``with_custodian_and_ward`` 5275517Snate@binkert.org* New ``pybind11::base<>`` attribute to indicate a subclass relationship 5285517Snate@binkert.org* Improved interface for RAII type wrappers in ``pytypes.h`` 5295517Snate@binkert.org* Use RAII type wrappers consistently within pybind11 itself. This 5305517Snate@binkert.org fixes various potential refcount leaks when exceptions occur 5315517Snate@binkert.org* Added new ``bytes`` RAII type wrapper (maps to ``string`` in Python 2.7) 5325517Snate@binkert.org* Made handle and related RAII classes const correct, using them more 5335517Snate@binkert.org consistently everywhere now 5345517Snate@binkert.org* Got rid of the ugly ``__pybind11__`` attributes on the Python side---they are 5355517Snate@binkert.org now stored in a C++ hash table that is not visible in Python 5365517Snate@binkert.org* Fixed refcount leaks involving NumPy arrays and bound functions 5375517Snate@binkert.org* Vastly improved handling of shared/smart pointers 5385517Snate@binkert.org* Removed an unnecessary copy operation in ``pybind11::vectorize`` 5395517Snate@binkert.org* Fixed naming clashes when both pybind11 and NumPy headers are included 5405517Snate@binkert.org* Added conversions for additional exception types 5415517Snate@binkert.org* Documentation improvements (using multiple extension modules, smart pointers, 5425517Snate@binkert.org other minor clarifications) 5435517Snate@binkert.org* unified infrastructure for parsing variadic arguments in ``class_`` and cpp_function 5445517Snate@binkert.org* Fixed license text (was: ZLIB, should have been: 3-clause BSD) 5455517Snate@binkert.org* Python 3.2 compatibility 5465517Snate@binkert.org* Fixed remaining issues when accessing types in another plugin module 5475517Snate@binkert.org* Added enum comparison and casting methods 5485517Snate@binkert.org* Improved SFINAE-based detection of whether types are copy-constructible 5495517Snate@binkert.org* Eliminated many warnings about unused variables and the use of ``offsetof()`` 5505517Snate@binkert.org* Support for ``std::array<>`` conversions 5515517Snate@binkert.org 5525517Snate@binkert.org1.1 (December 7, 2015) 5535517Snate@binkert.org-------------------------- 5545517Snate@binkert.org 5555517Snate@binkert.org* Documentation improvements (GIL, wrapping functions, casting, fixed many typos) 5565517Snate@binkert.org* Generalized conversion of integer types 5575517Snate@binkert.org* Improved support for casting function objects 5585517Snate@binkert.org* Improved support for ``std::shared_ptr<>`` conversions 5595517Snate@binkert.org* Initial support for ``std::set<>`` conversions 5605517Snate@binkert.org* Fixed type resolution issue for types defined in a separate plugin module 5615517Snate@binkert.org* Cmake build system improvements 5625610Snate@binkert.org* Factored out generic functionality to non-templated code (smaller code size) 5635623Snate@binkert.org* Added a code size / compile time benchmark vs Boost.Python 5645623Snate@binkert.org* Added an appveyor CI script 5655623Snate@binkert.org 5665610Snate@binkert.org1.0 (October 15, 2015) 5675517Snate@binkert.org------------------------ 5685623Snate@binkert.org* Initial release 5695623Snate@binkert.org