You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
12 KiB

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