changelog.rst revision 11986:c12e4625ab56
1.. _changelog: 2 3Changelog 4######### 5 6Starting with version 1.8, pybind11 releases use a 7[semantic versioning](http://semver.org) policy. 8 9Breaking changes queued for v2.0.0 (Not yet released) 10----------------------------------------------------- 11* Redesigned virtual call mechanism and user-facing syntax (see 12 https://github.com/pybind/pybind11/commit/86d825f3302701d81414ddd3d38bcd09433076bc) 13 14* Remove ``handle.call()`` method 15 161.9.0 (Not yet released) 17------------------------ 18* Queued changes: map indexing suite, documentation for indexing suites. 19* Mapping a stateless C++ function to Python and back is now "for free" (i.e. no call overheads) 20* Support for translation of arbitrary C++ exceptions to Python counterparts 21* Added ``eval`` and ``eval_file`` functions for evaluating expressions and 22 statements from a string or file 23* eigen.h type converter fixed for non-contiguous arrays (e.g. slices) 24* Print more informative error messages when ``make_tuple()`` or ``cast()`` fail 25* ``std::enable_shared_from_this<>`` now also works for ``const`` values 26* A return value policy can now be passed to ``handle::operator()`` 27* ``make_iterator()`` improvements for better compatibility with various types 28 (now uses prefix increment operator); it now also accepts iterators with 29 different begin/end types as long as they are equality comparable. 30* ``arg()`` now accepts a wider range of argument types for default values 31* Added ``py::repr()`` function which is equivalent to Python's builtin ``repr()``. 32* Added support for registering structured dtypes via ``PYBIND11_NUMPY_DTYPE()`` macro. 33* Added ``PYBIND11_STR_TYPE`` macro which maps to the ``builtins.str`` type. 34* Added a simplified ``buffer_info`` constructor for 1-dimensional buffers. 35* Format descriptor strings should now be accessed via ``format_descriptor::format()`` 36 (for compatibility purposes, the old syntax ``format_descriptor::value`` will still 37 work for non-structured data types). 38* Added a class wrapping NumPy array descriptors: ``dtype``. 39* Added buffer/NumPy support for ``char[N]`` and ``std::array<char, N>`` types. 40* ``array`` gained new constructors accepting dtype objects. 41* Added constructors for ``array`` and ``array_t`` explicitly accepting shape and 42 strides; if strides are not provided, they are deduced assuming C-contiguity. 43 Also added simplified constructors for 1-dimensional case. 44* Added constructors for ``str`` from ``bytes`` and for ``bytes`` from ``str``. 45 This will do the UTF-8 decoding/encoding as required. 46* Added constructors for ``str`` and ``bytes`` from zero-terminated char pointers, 47 and from char pointers and length. 48* Added ``memoryview`` wrapper type which is constructible from ``buffer_info``. 49* New syntax to call a Python function from C++ using keyword arguments and unpacking, 50 e.g. ``foo(1, 2, "z"_a=3)`` or ``bar(1, *args, "z"_a=3, **kwargs)``. 51* Added ``py::print()`` function which replicates Python's API and writes to Python's 52 ``sys.stdout`` by default (as opposed to C's ``stdout`` like ``std::cout``). 53* Added ``py::dict`` keyword constructor:``auto d = dict("number"_a=42, "name"_a="World");`` 54* Added ``py::str::format()`` method and ``_s`` literal: 55 ``py::str s = "1 + 2 = {}"_s.format(3);`` 56* Attribute and item accessors now have a more complete interface which makes it possible 57 to chain attributes ``obj.attr("a")[key].attr("b").attr("method")(1, 2, 3)```. 58* Added built-in support for ``std::shared_ptr`` holder type. There is no more need 59 to do it manually via ``PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)``. 60* Default return values policy changes: non-static properties now use ``reference_internal`` 61 and static properties use ``reference`` (previous default was ``automatic``, i.e. ``copy``). 62* Support for ``std::experimental::optional<T>`` and ``std::optional<T>`` (C++17). 63* Various minor improvements of library internals (no user-visible changes) 64 651.8.1 (July 12, 2016) 66---------------------- 67* Fixed a rare but potentially very severe issue when the garbage collector ran 68 during pybind11 type creation. 69 701.8.0 (June 14, 2016) 71---------------------- 72* Redesigned CMake build system which exports a convenient 73 ``pybind11_add_module`` function to parent projects. 74* ``std::vector<>`` type bindings analogous to Boost.Python's ``indexing_suite`` 75* Transparent conversion of sparse and dense Eigen matrices and vectors (``eigen.h``) 76* Added an ``ExtraFlags`` template argument to the NumPy ``array_t<>`` wrapper 77 to disable an enforced cast that may lose precision, e.g. to create overloads 78 for different precisions and complex vs real-valued matrices. 79* Prevent implicit conversion of floating point values to integral types in 80 function arguments 81* Fixed incorrect default return value policy for functions returning a shared 82 pointer 83* Don't allow registering a type via ``class_`` twice 84* Don't allow casting a ``None`` value into a C++ lvalue reference 85* Fixed a crash in ``enum_::operator==`` that was triggered by the ``help()`` command 86* Improved detection of whether or not custom C++ types can be copy/move-constructed 87* Extended ``str`` type to also work with ``bytes`` instances 88* Added a ``"name"_a`` user defined string literal that is equivalent to ``py::arg("name")``. 89* When specifying function arguments via ``py::arg``, the test that verifies 90 the number of arguments now runs at compile time. 91* Added ``[[noreturn]]`` attribute to ``pybind11_fail()`` to quench some 92 compiler warnings 93* List function arguments in exception text when the dispatch code cannot find 94 a matching overload 95* Added ``PYBIND11_OVERLOAD_NAME`` and ``PYBIND11_OVERLOAD_PURE_NAME`` macros which 96 can be used to override virtual methods whose name differs in C++ and Python 97 (e.g. ``__call__`` and ``operator()``) 98* Various minor ``iterator`` and ``make_iterator()`` improvements 99* Transparently support ``__bool__`` on Python 2.x and Python 3.x 100* Fixed issue with destructor of unpickled object not being called 101* Minor CMake build system improvements on Windows 102* New ``pybind11::args`` and ``pybind11::kwargs`` types to create functions which 103 take an arbitrary number of arguments and keyword arguments 104* New syntax to call a Python function from C++ using ``*args`` and ``*kwargs`` 105* The functions ``def_property_*`` now correctly process docstring arguments (these 106 formerly caused a segmentation fault) 107* Many ``mkdoc.py`` improvements (enumerations, template arguments, ``DOC()`` 108 macro accepts more arguments) 109* Cygwin support 110* Documentation improvements (pickling support, ``keep_alive``, macro usage) 111 1121.7 (April 30, 2016) 113---------------------- 114* Added a new ``move`` return value policy that triggers C++11 move semantics. 115 The automatic return value policy falls back to this case whenever a rvalue 116 reference is encountered 117* Significantly more general GIL state routines that are used instead of 118 Python's troublesome ``PyGILState_Ensure`` and ``PyGILState_Release`` API 119* Redesign of opaque types that drastically simplifies their usage 120* Extended ability to pass values of type ``[const] void *`` 121* ``keep_alive`` fix: don't fail when there is no patient 122* ``functional.h``: acquire the GIL before calling a Python function 123* Added Python RAII type wrappers ``none`` and ``iterable`` 124* Added ``*args`` and ``*kwargs`` pass-through parameters to 125 ``pybind11.get_include()`` function 126* Iterator improvements and fixes 127* Documentation on return value policies and opaque types improved 128 1291.6 (April 30, 2016) 130---------------------- 131* Skipped due to upload to PyPI gone wrong and inability to recover 132 (https://github.com/pypa/packaging-problems/issues/74) 133 1341.5 (April 21, 2016) 135---------------------- 136* For polymorphic types, use RTTI to try to return the closest type registered with pybind11 137* Pickling support for serializing and unserializing C++ instances to a byte stream in Python 138* Added a convenience routine ``make_iterator()`` which turns a range indicated 139 by a pair of C++ iterators into a iterable Python object 140* Added ``len()`` and a variadic ``make_tuple()`` function 141* Addressed a rare issue that could confuse the current virtual function 142 dispatcher and another that could lead to crashes in multi-threaded 143 applications 144* Added a ``get_include()`` function to the Python module that returns the path 145 of the directory containing the installed pybind11 header files 146* Documentation improvements: import issues, symbol visibility, pickling, limitations 147* Added casting support for ``std::reference_wrapper<>`` 148 1491.4 (April 7, 2016) 150-------------------------- 151* Transparent type conversion for ``std::wstring`` and ``wchar_t`` 152* Allow passing ``nullptr``-valued strings 153* Transparent passing of ``void *`` pointers using capsules 154* Transparent support for returning values wrapped in ``std::unique_ptr<>`` 155* Improved docstring generation for compatibility with Sphinx 156* Nicer debug error message when default parameter construction fails 157* Support for "opaque" types that bypass the transparent conversion layer for STL containers 158* Redesigned type casting interface to avoid ambiguities that could occasionally cause compiler errors 159* Redesigned property implementation; fixes crashes due to an unfortunate default return value policy 160* Anaconda package generation support 161 1621.3 (March 8, 2016) 163-------------------------- 164 165* Added support for the Intel C++ compiler (v15+) 166* Added support for the STL unordered set/map data structures 167* Added support for the STL linked list data structure 168* NumPy-style broadcasting support in ``pybind11::vectorize`` 169* pybind11 now displays more verbose error messages when ``arg::operator=()`` fails 170* pybind11 internal data structures now live in a version-dependent namespace to avoid ABI issues 171* Many, many bugfixes involving corner cases and advanced usage 172 1731.2 (February 7, 2016) 174-------------------------- 175 176* Optional: efficient generation of function signatures at compile time using C++14 177* Switched to a simpler and more general way of dealing with function default 178 arguments. Unused keyword arguments in function calls are now detected and 179 cause errors as expected 180* New ``keep_alive`` call policy analogous to Boost.Python's ``with_custodian_and_ward`` 181* New ``pybind11::base<>`` attribute to indicate a subclass relationship 182* Improved interface for RAII type wrappers in ``pytypes.h`` 183* Use RAII type wrappers consistently within pybind11 itself. This 184 fixes various potential refcount leaks when exceptions occur 185* Added new ``bytes`` RAII type wrapper (maps to ``string`` in Python 2.7) 186* Made handle and related RAII classes const correct, using them more 187 consistently everywhere now 188* Got rid of the ugly ``__pybind11__`` attributes on the Python side---they are 189 now stored in a C++ hash table that is not visible in Python 190* Fixed refcount leaks involving NumPy arrays and bound functions 191* Vastly improved handling of shared/smart pointers 192* Removed an unnecessary copy operation in ``pybind11::vectorize`` 193* Fixed naming clashes when both pybind11 and NumPy headers are included 194* Added conversions for additional exception types 195* Documentation improvements (using multiple extension modules, smart pointers, 196 other minor clarifications) 197* unified infrastructure for parsing variadic arguments in ``class_`` and cpp_function 198* Fixed license text (was: ZLIB, should have been: 3-clause BSD) 199* Python 3.2 compatibility 200* Fixed remaining issues when accessing types in another plugin module 201* Added enum comparison and casting methods 202* Improved SFINAE-based detection of whether types are copy-constructible 203* Eliminated many warnings about unused variables and the use of ``offsetof()`` 204* Support for ``std::array<>`` conversions 205 2061.1 (December 7, 2015) 207-------------------------- 208 209* Documentation improvements (GIL, wrapping functions, casting, fixed many typos) 210* Generalized conversion of integer types 211* Improved support for casting function objects 212* Improved support for ``std::shared_ptr<>`` conversions 213* Initial support for ``std::set<>`` conversions 214* Fixed type resolution issue for types defined in a separate plugin module 215* Cmake build system improvements 216* Factored out generic functionality to non-templated code (smaller code size) 217* Added a code size / compile time benchmark vs Boost.Python 218* Added an appveyor CI script 219 2201.0 (October 15, 2015) 221------------------------ 222* Initial release 223