blob: eaf8c2533972b4718d245609e98ae97090955dcb [file] [log] [blame]
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001.. _changelog:
2
3Changelog
4#########
5
Wenzel Jakobed52f462016-12-26 13:18:26 +01006Starting with version 1.8.0, pybind11 releases use a `semantic versioning
Wenzel Jakobd3549d62016-12-23 16:01:04 +01007<http://semver.org>`_ policy.
Wenzel Jakobf9502152016-06-14 15:00:46 +02008
Wenzel Jakob00a0aa92019-09-19 23:06:22 +02009v2.4.0 (Sep 19, 2019)
Wenzel Jakob64f2a5f2019-06-12 21:03:40 +020010-----------------------------------------------------
11
Wenzel Jakob00a0aa92019-09-19 23:06:22 +020012* Try harder to keep pybind11-internal data structures separate when there
13 are potential ABI incompatibilities. Fixes crashes that occurred when loading
14 multiple pybind11 extensions that were e.g. compiled by GCC (libstdc++)
15 and Clang (libc++).
16 `1588 <https://github.com/pybind/pybind11/pull/1588>`_ and
17 `c9f5a <https://github.com/pybind/pybind11/commit/c9f5a>`_.
18
19* Added support for ``__await__``, ``__aiter__``, and ``__anext__`` protocols.
20 `1842 <https://github.com/pybind/pybind11/pull/1842>`_.
21
22* ``pybind11_add_module()``: don't strip symbols when compiling in
23 ``RelWithDebInfo`` mode. `1980
24 <https://github.com/pybind/pybind11/pull/1980>`_.
25
26* ``enum_``: Reproduce Python behavior when comparing against invalid values
27 (e.g. ``None``, strings, etc.). Add back support for ``__invert__()``.
28 `1912 <https://github.com/pybind/pybind11/pull/1912>`_,
29 `1907 <https://github.com/pybind/pybind11/pull/1907>`_.
30
31* List insertion operation for ``py::list``.
32 Added ``.empty()`` to all collection types.
33 Added ``py::set::contains()`` and ``py::dict::contains()``.
34 `1887 <https://github.com/pybind/pybind11/pull/1887>`_,
35 `1884 <https://github.com/pybind/pybind11/pull/1884>`_,
36 `1888 <https://github.com/pybind/pybind11/pull/1888>`_.
37
Andre Schmeißer19189b42019-08-19 12:54:33 +020038* ``py::details::overload_cast_impl`` is available in C++11 mode, can be used
39 like ``overload_cast`` with an additional set of parantheses.
40 `1581 <https://github.com/pybind/pybind11/pull/1581>`_.
Wenzel Jakob64f2a5f2019-06-12 21:03:40 +020041
Wenzel Jakob00a0aa92019-09-19 23:06:22 +020042* ``overload_cast_impl`` is now available in C++11.
43 `1581 <https://github.com/pybind/pybind11/pull/1581>`_.
44
45* Fixed ``get_include()`` on Conda.
46 `1877 <https://github.com/pybind/pybind11/pull/1877>`_.
47
48* ``stl_bind.h``: negative indexing support.
49 `1882 <https://github.com/pybind/pybind11/pull/1882>`_.
50
51* Minor CMake fix to add MinGW compatibility.
52 `1851 <https://github.com/pybind/pybind11/pull/1851>`_.
53
54* GIL-related fixes.
55 `1836 <https://github.com/pybind/pybind11/pull/1836>`_,
56 `8b90b <https://github.com/pybind/pybind11/commit/8b90b>`_.
57
58* Other very minor/subtle fixes and improvements.
59 `1329 <https://github.com/pybind/pybind11/pull/1329>`_,
60 `1910 <https://github.com/pybind/pybind11/pull/1910>`_,
61 `1863 <https://github.com/pybind/pybind11/pull/1863>`_,
62 `1847 <https://github.com/pybind/pybind11/pull/1847>`_,
63 `1890 <https://github.com/pybind/pybind11/pull/1890>`_,
64 `1860 <https://github.com/pybind/pybind11/pull/1860>`_,
65 `1848 <https://github.com/pybind/pybind11/pull/1848>`_,
66 `1821 <https://github.com/pybind/pybind11/pull/1821>`_,
67 `1837 <https://github.com/pybind/pybind11/pull/1837>`_,
68 `1833 <https://github.com/pybind/pybind11/pull/1833>`_,
69 `1748 <https://github.com/pybind/pybind11/pull/1748>`_,
70 `1852 <https://github.com/pybind/pybind11/pull/1852>`_.
71
Wenzel Jakobcf36e3d2019-06-11 22:03:10 +020072v2.3.0 (June 11, 2019)
Wenzel Jakob8cf091a2017-08-31 14:01:08 +020073-----------------------------------------------------
74
Dean Moldovan56613942017-07-02 12:52:00 +020075* Significantly reduced module binary size (10-20%) when compiled in C++11 mode
76 with GCC/Clang, or in any mode with MSVC. Function signatures are now always
77 precomputed at compile time (this was previously only available in C++14 mode
78 for non-MSVC compilers).
79 `#934 <https://github.com/pybind/pybind11/pull/934>`_.
Wenzel Jakob8cf091a2017-08-31 14:01:08 +020080
Wenzel Jakob35c82c72018-09-11 10:08:48 +020081* Add basic support for tag-based static polymorphism, where classes
82 provide a method to returns the desired type of an instance.
83 `#1326 <https://github.com/pybind/pybind11/pull/1326>`_.
84
Wenzel Jakobf4245182018-09-01 01:20:24 +020085* Python type wrappers (``py::handle``, ``py::object``, etc.)
86 now support map Python's number protocol onto C++ arithmetic
87 operators such as ``operator+``, ``operator/=``, etc.
88 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.
89
Wenzel Jakob35c82c72018-09-11 10:08:48 +020090* A number of improvements related to enumerations:
91
92 1. The ``enum_`` implementation was rewritten from scratch to reduce
93 code bloat. Rather than instantiating a full implementation for each
94 enumeration, most code is now contained in a generic base class.
95 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.
96
97 2. The ``value()`` method of ``py::enum_`` now accepts an optional
98 docstring that will be shown in the documentation of the associated
99 enumeration. `#1160 <https://github.com/pybind/pybind11/pull/1160>`_.
100
101 3. check for already existing enum value and throw an error if present.
102 `#1453 <https://github.com/pybind/pybind11/pull/1453>`_.
103
Wenzel Jakobcf36e3d2019-06-11 22:03:10 +0200104* Support for over-aligned type allocation via C++17's aligned ``new``
105 statement. `#1582 <https://github.com/pybind/pybind11/pull/1582>`_.
106
107* Added ``py::ellipsis()`` method for slicing of multidimensional NumPy arrays
Wenzel Jakob35c82c72018-09-11 10:08:48 +0200108 `#1502 <https://github.com/pybind/pybind11/pull/1502>`_.
109
Wenzel Jakobcf36e3d2019-06-11 22:03:10 +0200110* Numerous Improvements to the ``mkdoc.py`` script for extracting documentation
111 from C++ header files.
112 `#1788 <https://github.com/pybind/pybind11/pull/1788>`_.
113
Wenzel Jakob35c82c72018-09-11 10:08:48 +0200114* ``pybind11_add_module()``: allow including Python as a ``SYSTEM`` include path.
115 `#1416 <https://github.com/pybind/pybind11/pull/1416>`_.
116
Allan Leale76dff72018-10-11 10:28:12 +0200117* ``pybind11/stl.h`` does not convert strings to ``vector<string>`` anymore.
118 `#1258 <https://github.com/pybind/pybind11/issues/1258>`_.
119
Wenzel Jakobcf36e3d2019-06-11 22:03:10 +0200120* Mark static methods as such to fix auto-generated Sphinx documentation.
121 `#1732 <https://github.com/pybind/pybind11/pull/1732>`_.
122
123* Re-throw forced unwind exceptions (e.g. during pthread termination).
124 `#1208 <https://github.com/pybind/pybind11/pull/1208>`_.
125
126* Added ``__contains__`` method to the bindings of maps (``std::map``,
127 ``std::unordered_map``).
128 `#1767 <https://github.com/pybind/pybind11/pull/1767>`_.
129
130* Improvements to ``gil_scoped_acquire``.
131 `#1211 <https://github.com/pybind/pybind11/pull/1211>`_.
132
133* Type caster support for ``std::deque<T>``.
134 `#1609 <https://github.com/pybind/pybind11/pull/1609>`_.
135
136* Support for ``std::unique_ptr`` holders, whose deleters differ between a base and derived
137 class. `#1353 <https://github.com/pybind/pybind11/pull/1353>`_.
138
139* Construction of STL array/vector-like data structures from
140 iterators. Added an ``extend()`` operation.
141 `#1709 <https://github.com/pybind/pybind11/pull/1709>`_,
142
143* CMake build system improvements for projects that include non-C++
144 files (e.g. plain C, CUDA) in ``pybind11_add_module`` et al.
145 `#1678 <https://github.com/pybind/pybind11/pull/1678>`_.
146
147* Fixed asynchronous invocation and deallocation of Python functions
148 wrapped in ``std::function``.
149 `#1595 <https://github.com/pybind/pybind11/pull/1595>`_.
150
151* Fixes regarding return value policy propagation in STL type casters.
152 `#1603 <https://github.com/pybind/pybind11/pull/1603>`_.
153
154* Fixed scoped enum comparisons.
155 `#1571 <https://github.com/pybind/pybind11/pull/1571>`_.
156
157* Fixed iostream redirection for code that releases the GIL.
158 `#1368 <https://github.com/pybind/pybind11/pull/1368>`_,
159
160* A number of CI-related fixes.
161 `#1757 <https://github.com/pybind/pybind11/pull/1757>`_,
162 `#1744 <https://github.com/pybind/pybind11/pull/1744>`_,
163 `#1670 <https://github.com/pybind/pybind11/pull/1670>`_.
164
Wenzel Jakob35c82c72018-09-11 10:08:48 +0200165v2.2.4 (September 11, 2018)
166-----------------------------------------------------
167
168* Use new Python 3.7 Thread Specific Storage (TSS) implementation if available.
169 `#1454 <https://github.com/pybind/pybind11/pull/1454>`_,
170 `#1517 <https://github.com/pybind/pybind11/pull/1517>`_.
171
172* Fixes for newer MSVC versions and C++17 mode.
173 `#1347 <https://github.com/pybind/pybind11/pull/1347>`_,
174 `#1462 <https://github.com/pybind/pybind11/pull/1462>`_.
175
176* Propagate return value policies to type-specific casters
177 when casting STL containers.
178 `#1455 <https://github.com/pybind/pybind11/pull/1455>`_.
179
180* Allow ostream-redirection of more than 1024 characters.
181 `#1479 <https://github.com/pybind/pybind11/pull/1479>`_.
182
183* Set ``Py_DEBUG`` define when compiling against a debug Python build.
184 `#1438 <https://github.com/pybind/pybind11/pull/1438>`_.
185
186* Untangle integer logic in number type caster to work for custom
187 types that may only be castable to a restricted set of builtin types.
188 `#1442 <https://github.com/pybind/pybind11/pull/1442>`_.
189
190* CMake build system: Remember Python version in cache file.
191 `#1434 <https://github.com/pybind/pybind11/pull/1434>`_.
192
193* Fix for custom smart pointers: use ``std::addressof`` to obtain holder
194 address instead of ``operator&``.
195 `#1435 <https://github.com/pybind/pybind11/pull/1435>`_.
196
197* Properly report exceptions thrown during module initialization.
198 `#1362 <https://github.com/pybind/pybind11/pull/1362>`_.
199
200* Fixed a segmentation fault when creating empty-shaped NumPy array.
201 `#1371 <https://github.com/pybind/pybind11/pull/1371>`_.
202
203* The version of Intel C++ compiler must be >= 2017, and this is now checked by
204 the header files. `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.
205
206* A few minor typo fixes and improvements to the test suite, and
207 patches that silence compiler warnings.
Wenzel Jakob6d190362017-11-16 22:24:36 +0100208
Chris Rusby22859bb2018-08-22 22:38:27 +0100209* Vectors now support construction from generators, as well as ``extend()`` from a
210 list or generator.
211 `#1496 <https://github.com/pybind/pybind11/pull/1496>`_.
212
213
Wenzel Jakobf5f66182018-04-29 15:47:03 +0200214v2.2.3 (April 29, 2018)
215-----------------------------------------------------
216
217* The pybind11 header location detection was replaced by a new implementation
218 that no longer depends on ``pip`` internals (the recently released ``pip``
219 10 has restricted access to this API).
220 `#1190 <https://github.com/pybind/pybind11/pull/1190>`_.
221
222* Small adjustment to an implementation detail to work around a compiler segmentation fault in Clang 3.3/3.4.
223 `#1350 <https://github.com/pybind/pybind11/pull/1350>`_.
224
225* The minimal supported version of the Intel compiler was >= 17.0 since
226 pybind11 v2.1. This check is now explicit, and a compile-time error is raised
227 if the compiler meet the requirement.
228 `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.
229
230* Fixed an endianness-related fault in the test suite.
231 `#1287 <https://github.com/pybind/pybind11/pull/1287>`_.
Lori A. Burnsbdbe8d02018-04-29 07:48:25 -0400232
Wenzel Jakob2d0507d2018-02-07 11:05:41 +0100233v2.2.2 (February 7, 2018)
234-----------------------------------------------------
235
236* Fixed a segfault when combining embedded interpreter
237 shutdown/reinitialization with external loaded pybind11 modules.
238 `#1092 <https://github.com/pybind/pybind11/pull/1092>`_.
239
240* Eigen support: fixed a bug where Nx1/1xN numpy inputs couldn't be passed as
241 arguments to Eigen vectors (which for Eigen are simply compile-time fixed
242 Nx1/1xN matrices).
243 `#1106 <https://github.com/pybind/pybind11/pull/1106>`_.
244
245* Clarified to license by moving the licensing of contributions from
246 ``LICENSE`` into ``CONTRIBUTING.md``: the licensing of contributions is not
247 actually part of the software license as distributed. This isn't meant to be
248 a substantial change in the licensing of the project, but addresses concerns
249 that the clause made the license non-standard.
250 `#1109 <https://github.com/pybind/pybind11/issues/1109>`_.
251
252* Fixed a regression introduced in 2.1 that broke binding functions with lvalue
253 character literal arguments.
254 `#1128 <https://github.com/pybind/pybind11/pull/1128>`_.
255
256* MSVC: fix for compilation failures under /permissive-, and added the flag to
257 the appveyor test suite.
258 `#1155 <https://github.com/pybind/pybind11/pull/1155>`_.
259
260* Fixed ``__qualname__`` generation, and in turn, fixes how class names
261 (especially nested class names) are shown in generated docstrings.
262 `#1171 <https://github.com/pybind/pybind11/pull/1171>`_.
263
264* Updated the FAQ with a suggested project citation reference.
265 `#1189 <https://github.com/pybind/pybind11/pull/1189>`_.
266
267* Added fixes for deprecation warnings when compiled under C++17 with
268 ``-Wdeprecated`` turned on, and add ``-Wdeprecated`` to the test suite
269 compilation flags.
270 `#1191 <https://github.com/pybind/pybind11/pull/1191>`_.
271
272* Fixed outdated PyPI URLs in ``setup.py``.
273 `#1213 <https://github.com/pybind/pybind11/pull/1213>`_.
274
275* Fixed a refcount leak for arguments that end up in a ``py::args`` argument
276 for functions with both fixed positional and ``py::args`` arguments.
277 `#1216 <https://github.com/pybind/pybind11/pull/1216>`_.
278
279* Fixed a potential segfault resulting from possible premature destruction of
280 ``py::args``/``py::kwargs`` arguments with overloaded functions.
281 `#1223 <https://github.com/pybind/pybind11/pull/1223>`_.
282
283* Fixed ``del map[item]`` for a ``stl_bind.h`` bound stl map.
284 `#1229 <https://github.com/pybind/pybind11/pull/1229>`_.
285
286* Fixed a regression from v2.1.x where the aggregate initialization could
287 unintentionally end up at a constructor taking a templated
288 ``std::initializer_list<T>`` argument.
289 `#1249 <https://github.com/pybind/pybind11/pull/1249>`_.
290
291* Fixed an issue where calling a function with a keep_alive policy on the same
292 nurse/patient pair would cause the internal patient storage to needlessly
293 grow (unboundedly, if the nurse is long-lived).
294 `#1251 <https://github.com/pybind/pybind11/issues/1251>`_.
295
296* Various other minor fixes.
297
Wenzel Jakobf94d7592017-09-14 08:49:47 +0200298v2.2.1 (September 14, 2017)
Dean Moldovan7939f4b2017-09-04 13:49:19 +0200299-----------------------------------------------------
300
Dean Moldovan27680302017-09-13 19:04:25 +0200301* Added ``py::module::reload()`` member function for reloading a module.
302 `#1040 <https://github.com/pybind/pybind11/pull/1040>`_.
Dean Moldovanb0a0e4a2017-09-04 21:16:09 +0200303
Dean Moldovan953d2422017-09-10 16:53:02 +0200304* Fixed a reference leak in the number converter.
305 `#1078 <https://github.com/pybind/pybind11/pull/1078>`_.
306
Dean Moldovan27680302017-09-13 19:04:25 +0200307* Fixed compilation with Clang on host GCC < 5 (old libstdc++ which isn't fully
308 C++11 compliant). `#1062 <https://github.com/pybind/pybind11/pull/1062>`_.
309
Dean Moldovan3c4933c2017-09-01 21:42:20 +0200310* Fixed a regression where the automatic ``std::vector<bool>`` caster would
311 fail to compile. The same fix also applies to any container which returns
312 element proxies instead of references.
313 `#1053 <https://github.com/pybind/pybind11/pull/1053>`_.
314
Dean Moldovan7939f4b2017-09-04 13:49:19 +0200315* Fixed a regression where the ``py::keep_alive`` policy could not be applied
316 to constructors. `#1065 <https://github.com/pybind/pybind11/pull/1065>`_.
317
Dean Moldovan7b1de1e2017-09-03 01:31:47 +0200318* Fixed a nullptr dereference when loading a ``py::module_local`` type
319 that's only registered in an external module.
320 `#1058 <https://github.com/pybind/pybind11/pull/1058>`_.
321
Dean Moldovan27680302017-09-13 19:04:25 +0200322* Fixed implicit conversion of accessors to types derived from ``py::object``.
323 `#1076 <https://github.com/pybind/pybind11/pull/1076>`_.
324
325* The ``name`` in ``PYBIND11_MODULE(name, variable)`` can now be a macro.
326 `#1082 <https://github.com/pybind/pybind11/pull/1082>`_.
327
328* Relaxed overly strict ``py::pickle()`` check for matching get and set types.
329 `#1064 <https://github.com/pybind/pybind11/pull/1064>`_.
330
Dean Moldovan2b4477e2017-09-09 20:21:34 +0200331* Conversion errors now try to be more informative when it's likely that
332 a missing header is the cause (e.g. forgetting ``<pybind11/stl.h>``).
333 `#1077 <https://github.com/pybind/pybind11/pull/1077>`_.
334
Wenzel Jakob2a5a5ec2017-08-31 13:58:24 +0200335v2.2.0 (August 31, 2017)
Wenzel Jakobd405b1b2017-03-22 22:20:07 +0100336-----------------------------------------------------
337
Dean Moldovandb46a892017-08-13 22:25:15 +0200338* Support for embedding the Python interpreter. See the
339 :doc:`documentation page </advanced/embedding>` for a
340 full overview of the new features.
341 `#774 <https://github.com/pybind/pybind11/pull/774>`_,
342 `#889 <https://github.com/pybind/pybind11/pull/889>`_,
343 `#892 <https://github.com/pybind/pybind11/pull/892>`_,
344 `#920 <https://github.com/pybind/pybind11/pull/920>`_.
345
346 .. code-block:: cpp
347
348 #include <pybind11/embed.h>
349 namespace py = pybind11;
350
351 int main() {
352 py::scoped_interpreter guard{}; // start the interpreter and keep it alive
353
354 py::print("Hello, World!"); // use the Python API
355 }
356
357* Support for inheriting from multiple C++ bases in Python.
358 `#693 <https://github.com/pybind/pybind11/pull/693>`_.
359
360 .. code-block:: python
361
362 from cpp_module import CppBase1, CppBase2
363
364 class PyDerived(CppBase1, CppBase2):
365 def __init__(self):
366 CppBase1.__init__(self) # C++ bases must be initialized explicitly
367 CppBase2.__init__(self)
368
369* ``PYBIND11_MODULE`` is now the preferred way to create module entry points.
370 ``PYBIND11_PLUGIN`` is deprecated. See :ref:`macros` for details.
371 `#879 <https://github.com/pybind/pybind11/pull/879>`_.
372
373 .. code-block:: cpp
374
375 // new
376 PYBIND11_MODULE(example, m) {
377 m.def("add", [](int a, int b) { return a + b; });
378 }
379
380 // old
381 PYBIND11_PLUGIN(example) {
382 py::module m("example");
383 m.def("add", [](int a, int b) { return a + b; });
384 return m.ptr();
385 }
386
387* pybind11's headers and build system now more strictly enforce hidden symbol
388 visibility for extension modules. This should be seamless for most users,
Dean Moldovan1fb9df62017-08-18 19:26:49 +0200389 but see the :doc:`upgrade` if you use a custom build system.
390 `#995 <https://github.com/pybind/pybind11/pull/995>`_.
Dean Moldovandb46a892017-08-13 22:25:15 +0200391
392* Support for ``py::module_local`` types which allow multiple modules to
393 export the same C++ types without conflicts. This is useful for opaque
394 types like ``std::vector<int>``. ``py::bind_vector`` and ``py::bind_map``
395 now default to ``py::module_local`` if their elements are builtins or
396 local types. See :ref:`module_local` for details.
397 `#949 <https://github.com/pybind/pybind11/pull/949>`_,
398 `#981 <https://github.com/pybind/pybind11/pull/981>`_,
399 `#995 <https://github.com/pybind/pybind11/pull/995>`_,
400 `#997 <https://github.com/pybind/pybind11/pull/997>`_.
401
402* Custom constructors can now be added very easily using lambdas or factory
403 functions which return a class instance by value, pointer or holder. This
404 supersedes the old placement-new ``__init__`` technique.
405 See :ref:`custom_constructors` for details.
Dean Moldovan4c540442017-08-30 21:53:08 +0200406 `#805 <https://github.com/pybind/pybind11/pull/805>`_,
407 `#1014 <https://github.com/pybind/pybind11/pull/1014>`_.
Dean Moldovandb46a892017-08-13 22:25:15 +0200408
409 .. code-block:: cpp
410
411 struct Example {
412 Example(std::string);
413 };
414
415 py::class_<Example>(m, "Example")
416 .def(py::init<std::string>()) // existing constructor
417 .def(py::init([](int n) { // custom constructor
418 return std::make_unique<Example>(std::to_string(n));
419 }));
420
Dean Moldovan1e5a7da2017-08-24 01:53:15 +0200421* Similarly to custom constructors, pickling support functions are now bound
422 using the ``py::pickle()`` adaptor which improves type safety. See the
423 :doc:`upgrade` and :ref:`pickling` for details.
424 `#1038 <https://github.com/pybind/pybind11/pull/1038>`_.
425
Dean Moldovandb46a892017-08-13 22:25:15 +0200426* Builtin support for converting C++17 standard library types and general
427 conversion improvements:
428
429 1. C++17 ``std::variant`` is supported right out of the box. C++11/14
430 equivalents (e.g. ``boost::variant``) can also be added with a simple
431 user-defined specialization. See :ref:`cpp17_container_casters` for details.
432 `#811 <https://github.com/pybind/pybind11/pull/811>`_,
433 `#845 <https://github.com/pybind/pybind11/pull/845>`_,
434 `#989 <https://github.com/pybind/pybind11/pull/989>`_.
435
436 2. Out-of-the-box support for C++17 ``std::string_view``.
437 `#906 <https://github.com/pybind/pybind11/pull/906>`_.
438
439 3. Improved compatibility of the builtin ``optional`` converter.
440 `#874 <https://github.com/pybind/pybind11/pull/874>`_.
441
442 4. The ``bool`` converter now accepts ``numpy.bool_`` and types which
443 define ``__bool__`` (Python 3.x) or ``__nonzero__`` (Python 2.7).
444 `#925 <https://github.com/pybind/pybind11/pull/925>`_.
445
446 5. C++-to-Python casters are now more efficient and move elements out
447 of rvalue containers whenever possible.
448 `#851 <https://github.com/pybind/pybind11/pull/851>`_,
449 `#936 <https://github.com/pybind/pybind11/pull/936>`_,
450 `#938 <https://github.com/pybind/pybind11/pull/938>`_.
451
452 6. Fixed ``bytes`` to ``std::string/char*`` conversion on Python 3.
453 `#817 <https://github.com/pybind/pybind11/pull/817>`_.
454
455 7. Fixed lifetime of temporary C++ objects created in Python-to-C++ conversions.
456 `#924 <https://github.com/pybind/pybind11/pull/924>`_.
457
Henry Schreiner8b405052017-08-24 17:12:43 -0700458* Scope guard call policy for RAII types, e.g. ``py::call_guard<py::gil_scoped_release>()``,
459 ``py::call_guard<py::scoped_ostream_redirect>()``. See :ref:`call_policies` for details.
Dean Moldovandb46a892017-08-13 22:25:15 +0200460 `#740 <https://github.com/pybind/pybind11/pull/740>`_.
461
Henry Schreiner8b405052017-08-24 17:12:43 -0700462* Utility for redirecting C++ streams to Python (e.g. ``std::cout`` ->
463 ``sys.stdout``). Scope guard ``py::scoped_ostream_redirect`` in C++ and
464 a context manager in Python. See :ref:`ostream_redirect`.
465 `#1009 <https://github.com/pybind/pybind11/pull/1009>`_.
466
Dean Moldovandb46a892017-08-13 22:25:15 +0200467* Improved handling of types and exceptions across module boundaries.
468 `#915 <https://github.com/pybind/pybind11/pull/915>`_,
469 `#951 <https://github.com/pybind/pybind11/pull/951>`_,
470 `#995 <https://github.com/pybind/pybind11/pull/995>`_.
471
472* Fixed destruction order of ``py::keep_alive`` nurse/patient objects
473 in reference cycles.
474 `#856 <https://github.com/pybind/pybind11/pull/856>`_.
475
476* Numpy and buffer protocol related improvements:
477
478 1. Support for negative strides in Python buffer objects/numpy arrays. This
479 required changing integers from unsigned to signed for the related C++ APIs.
480 Note: If you have compiler warnings enabled, you may notice some new conversion
481 warnings after upgrading. These can be resolved with ``static_cast``.
482 `#782 <https://github.com/pybind/pybind11/pull/782>`_.
483
484 2. Support ``std::complex`` and arrays inside ``PYBIND11_NUMPY_DTYPE``.
485 `#831 <https://github.com/pybind/pybind11/pull/831>`_,
486 `#832 <https://github.com/pybind/pybind11/pull/832>`_.
487
488 3. Support for constructing ``py::buffer_info`` and ``py::arrays`` using
489 arbitrary containers or iterators instead of requiring a ``std::vector``.
490 `#788 <https://github.com/pybind/pybind11/pull/788>`_,
491 `#822 <https://github.com/pybind/pybind11/pull/822>`_,
492 `#860 <https://github.com/pybind/pybind11/pull/860>`_.
493
494 4. Explicitly check numpy version and require >= 1.7.0.
495 `#819 <https://github.com/pybind/pybind11/pull/819>`_.
496
497* Support for allowing/prohibiting ``None`` for specific arguments and improved
498 ``None`` overload resolution order. See :ref:`none_arguments` for details.
499 `#843 <https://github.com/pybind/pybind11/pull/843>`_.
500 `#859 <https://github.com/pybind/pybind11/pull/859>`_.
501
502* Added ``py::exec()`` as a shortcut for ``py::eval<py::eval_statements>()``
503 and support for C++11 raw string literals as input. See :ref:`eval`.
504 `#766 <https://github.com/pybind/pybind11/pull/766>`_,
505 `#827 <https://github.com/pybind/pybind11/pull/827>`_.
506
507* ``py::vectorize()`` ignores non-vectorizable arguments and supports
508 member functions.
509 `#762 <https://github.com/pybind/pybind11/pull/762>`_.
510
511* Support for bound methods as callbacks (``pybind11/functional.h``).
512 `#815 <https://github.com/pybind/pybind11/pull/815>`_.
513
514* Allow aliasing pybind11 methods: ``cls.attr("foo") = cls.attr("bar")``.
515 `#802 <https://github.com/pybind/pybind11/pull/802>`_.
516
517* Don't allow mixed static/non-static overloads.
518 `#804 <https://github.com/pybind/pybind11/pull/804>`_.
519
520* Fixed overriding static properties in derived classes.
521 `#784 <https://github.com/pybind/pybind11/pull/784>`_.
522
Wenzel Jakobcf36e3d2019-06-11 22:03:10 +0200523* Added support for write only properties.
524 `#1144 <https://github.com/pybind/pybind11/pull/1144>`_.
525
Dean Moldovan4c540442017-08-30 21:53:08 +0200526* Improved deduction of member functions of a derived class when its bases
527 aren't registered with pybind11.
Dean Moldovandb46a892017-08-13 22:25:15 +0200528 `#855 <https://github.com/pybind/pybind11/pull/855>`_.
529
530 .. code-block:: cpp
531
532 struct Base {
533 int foo() { return 42; }
534 }
535
536 struct Derived : Base {}
537
538 // Now works, but previously required also binding `Base`
539 py::class_<Derived>(m, "Derived")
540 .def("foo", &Derived::foo); // function is actually from `Base`
541
Wenzel Jakobb12a9d62017-08-23 16:30:56 +0200542* The implementation of ``py::init<>`` now uses C++11 brace initialization
543 syntax to construct instances, which permits binding implicit constructors of
544 aggregate types. `#1015 <https://github.com/pybind/pybind11/pull/1015>`_.
545
546 .. code-block:: cpp
547
548 struct Aggregate {
549 int a;
550 std::string b;
551 };
552
553 py::class_<Aggregate>(m, "Aggregate")
554 .def(py::init<int, const std::string &>());
555
Dean Moldovandb46a892017-08-13 22:25:15 +0200556* Fixed issues with multiple inheritance with offset base/derived pointers.
557 `#812 <https://github.com/pybind/pybind11/pull/812>`_,
558 `#866 <https://github.com/pybind/pybind11/pull/866>`_,
559 `#960 <https://github.com/pybind/pybind11/pull/960>`_.
560
Dean Moldovan4c540442017-08-30 21:53:08 +0200561* Fixed reference leak of type objects.
562 `#1030 <https://github.com/pybind/pybind11/pull/1030>`_.
563
Dean Moldovandb46a892017-08-13 22:25:15 +0200564* Improved support for the ``/std:c++14`` and ``/std:c++latest`` modes
565 on MSVC 2017.
566 `#841 <https://github.com/pybind/pybind11/pull/841>`_,
567 `#999 <https://github.com/pybind/pybind11/pull/999>`_.
568
569* Fixed detection of private operator new on MSVC.
570 `#893 <https://github.com/pybind/pybind11/pull/893>`_,
571 `#918 <https://github.com/pybind/pybind11/pull/918>`_.
572
573* Intel C++ compiler compatibility fixes.
574 `#937 <https://github.com/pybind/pybind11/pull/937>`_.
575
576* Fixed implicit conversion of `py::enum_` to integer types on Python 2.7.
577 `#821 <https://github.com/pybind/pybind11/pull/821>`_.
578
Bruce Merry37de2da2017-08-30 14:22:00 +0200579* Added ``py::hash`` to fetch the hash value of Python objects, and
580 ``.def(hash(py::self))`` to provide the C++ ``std::hash`` as the Python
581 ``__hash__`` method.
582 `#1034 <https://github.com/pybind/pybind11/pull/1034>`_.
583
Dean Moldovandb46a892017-08-13 22:25:15 +0200584* Fixed ``__truediv__`` on Python 2 and ``__itruediv__`` on Python 3.
585 `#867 <https://github.com/pybind/pybind11/pull/867>`_.
586
587* ``py::capsule`` objects now support the ``name`` attribute. This is useful
588 for interfacing with ``scipy.LowLevelCallable``.
589 `#902 <https://github.com/pybind/pybind11/pull/902>`_.
590
591* Fixed ``py::make_iterator``'s ``__next__()`` for past-the-end calls.
592 `#897 <https://github.com/pybind/pybind11/pull/897>`_.
593
594* Added ``error_already_set::matches()`` for checking Python exceptions.
595 `#772 <https://github.com/pybind/pybind11/pull/772>`_.
596
597* Deprecated ``py::error_already_set::clear()``. It's no longer needed
598 following a simplification of the ``py::error_already_set`` class.
599 `#954 <https://github.com/pybind/pybind11/pull/954>`_.
600
601* Deprecated ``py::handle::operator==()`` in favor of ``py::handle::is()``
602 `#825 <https://github.com/pybind/pybind11/pull/825>`_.
603
604* Deprecated ``py::object::borrowed``/``py::object::stolen``.
605 Use ``py::object::borrowed_t{}``/``py::object::stolen_t{}`` instead.
606 `#771 <https://github.com/pybind/pybind11/pull/771>`_.
607
Dean Moldovan4c540442017-08-30 21:53:08 +0200608* Changed internal data structure versioning to avoid conflicts between
609 modules compiled with different revisions of pybind11.
610 `#1012 <https://github.com/pybind/pybind11/pull/1012>`_.
611
Dean Moldovandb46a892017-08-13 22:25:15 +0200612* Additional compile-time and run-time error checking and more informative messages.
613 `#786 <https://github.com/pybind/pybind11/pull/786>`_,
614 `#794 <https://github.com/pybind/pybind11/pull/794>`_,
615 `#803 <https://github.com/pybind/pybind11/pull/803>`_.
616
617* Various minor improvements and fixes.
618 `#764 <https://github.com/pybind/pybind11/pull/764>`_,
619 `#791 <https://github.com/pybind/pybind11/pull/791>`_,
620 `#795 <https://github.com/pybind/pybind11/pull/795>`_,
621 `#840 <https://github.com/pybind/pybind11/pull/840>`_,
622 `#844 <https://github.com/pybind/pybind11/pull/844>`_,
623 `#846 <https://github.com/pybind/pybind11/pull/846>`_,
624 `#849 <https://github.com/pybind/pybind11/pull/849>`_,
625 `#858 <https://github.com/pybind/pybind11/pull/858>`_,
626 `#862 <https://github.com/pybind/pybind11/pull/862>`_,
627 `#871 <https://github.com/pybind/pybind11/pull/871>`_,
628 `#872 <https://github.com/pybind/pybind11/pull/872>`_,
629 `#881 <https://github.com/pybind/pybind11/pull/881>`_,
630 `#888 <https://github.com/pybind/pybind11/pull/888>`_,
631 `#899 <https://github.com/pybind/pybind11/pull/899>`_,
632 `#928 <https://github.com/pybind/pybind11/pull/928>`_,
633 `#931 <https://github.com/pybind/pybind11/pull/931>`_,
634 `#944 <https://github.com/pybind/pybind11/pull/944>`_,
635 `#950 <https://github.com/pybind/pybind11/pull/950>`_,
636 `#952 <https://github.com/pybind/pybind11/pull/952>`_,
637 `#962 <https://github.com/pybind/pybind11/pull/962>`_,
638 `#965 <https://github.com/pybind/pybind11/pull/965>`_,
639 `#970 <https://github.com/pybind/pybind11/pull/970>`_,
Dean Moldovandb46a892017-08-13 22:25:15 +0200640 `#978 <https://github.com/pybind/pybind11/pull/978>`_,
Dean Moldovan4c540442017-08-30 21:53:08 +0200641 `#979 <https://github.com/pybind/pybind11/pull/979>`_,
Wenzel Jakoba1041192017-08-28 16:35:32 +0200642 `#986 <https://github.com/pybind/pybind11/pull/986>`_,
Dean Moldovan4c540442017-08-30 21:53:08 +0200643 `#1020 <https://github.com/pybind/pybind11/pull/1020>`_,
644 `#1027 <https://github.com/pybind/pybind11/pull/1027>`_,
Wenzel Jakoba1041192017-08-28 16:35:32 +0200645 `#1037 <https://github.com/pybind/pybind11/pull/1037>`_.
Dean Moldovandb46a892017-08-13 22:25:15 +0200646
647* Testing improvements.
648 `#798 <https://github.com/pybind/pybind11/pull/798>`_,
649 `#882 <https://github.com/pybind/pybind11/pull/882>`_,
650 `#898 <https://github.com/pybind/pybind11/pull/898>`_,
651 `#900 <https://github.com/pybind/pybind11/pull/900>`_,
652 `#921 <https://github.com/pybind/pybind11/pull/921>`_,
653 `#923 <https://github.com/pybind/pybind11/pull/923>`_,
654 `#963 <https://github.com/pybind/pybind11/pull/963>`_.
655
Wenzel Jakobdb200952017-04-07 02:03:46 +0200656v2.1.1 (April 7, 2017)
657-----------------------------------------------------
658
659* Fixed minimum version requirement for MSVC 2015u3
660 `#773 <https://github.com/pybind/pybind11/pull/773>`_.
661
Wenzel Jakobd405b1b2017-03-22 22:20:07 +0100662v2.1.0 (March 22, 2017)
Wenzel Jakoba9730be2017-01-06 14:18:44 +0100663-----------------------------------------------------
664
Wenzel Jakob62e5fef2017-03-22 22:07:45 +0100665* pybind11 now performs function overload resolution in two phases. The first
666 phase only considers exact type matches, while the second allows for implicit
667 conversions to take place. A special ``noconvert()`` syntax can be used to
668 completely disable implicit conversions for specific arguments.
669 `#643 <https://github.com/pybind/pybind11/pull/643>`_,
670 `#634 <https://github.com/pybind/pybind11/pull/634>`_,
671 `#650 <https://github.com/pybind/pybind11/pull/650>`_.
672
673* Fixed a regression where static properties no longer worked with classes
674 using multiple inheritance. The ``py::metaclass`` attribute is no longer
675 necessary (and deprecated as of this release) when binding classes with
676 static properties.
677 `#679 <https://github.com/pybind/pybind11/pull/679>`_,
678
679* Classes bound using ``pybind11`` can now use custom metaclasses.
680 `#679 <https://github.com/pybind/pybind11/pull/679>`_,
681
682* ``py::args`` and ``py::kwargs`` can now be mixed with other positional
683 arguments when binding functions using pybind11.
684 `#611 <https://github.com/pybind/pybind11/pull/611>`_.
685
686* Improved support for C++11 unicode string and character types; added
687 extensive documentation regarding pybind11's string conversion behavior.
688 `#624 <https://github.com/pybind/pybind11/pull/624>`_,
689 `#636 <https://github.com/pybind/pybind11/pull/636>`_,
690 `#715 <https://github.com/pybind/pybind11/pull/715>`_.
691
692* pybind11 can now avoid expensive copies when converting Eigen arrays to NumPy
693 arrays (and vice versa). `#610 <https://github.com/pybind/pybind11/pull/610>`_.
694
695* The "fast path" in ``py::vectorize`` now works for any full-size group of C or
696 F-contiguous arrays. The non-fast path is also faster since it no longer performs
697 copies of the input arguments (except when type conversions are necessary).
698 `#610 <https://github.com/pybind/pybind11/pull/610>`_.
699
700* Added fast, unchecked access to NumPy arrays via a proxy object.
701 `#746 <https://github.com/pybind/pybind11/pull/746>`_.
702
Wenzel Jakob0d929382017-03-22 22:52:29 +0100703* Transparent support for class-specific ``operator new`` and
Wenzel Jakob62e5fef2017-03-22 22:07:45 +0100704 ``operator delete`` implementations.
705 `#755 <https://github.com/pybind/pybind11/pull/755>`_.
706
707* Slimmer and more efficient STL-compatible iterator interface for sequence types.
708 `#662 <https://github.com/pybind/pybind11/pull/662>`_.
709
710* Improved custom holder type support.
711 `#607 <https://github.com/pybind/pybind11/pull/607>`_.
712
713* ``nullptr`` to ``None`` conversion fixed in various builtin type casters.
714 `#732 <https://github.com/pybind/pybind11/pull/732>`_.
715
716* ``enum_`` now exposes its members via a special ``__members__`` attribute.
717 `#666 <https://github.com/pybind/pybind11/pull/666>`_.
718
719* ``std::vector`` bindings created using ``stl_bind.h`` can now optionally
720 implement the buffer protocol. `#488 <https://github.com/pybind/pybind11/pull/488>`_.
721
722* Automated C++ reference documentation using doxygen and breathe.
723 `#598 <https://github.com/pybind/pybind11/pull/598>`_.
724
725* Added minimum compiler version assertions.
726 `#727 <https://github.com/pybind/pybind11/pull/727>`_.
727
728* Improved compatibility with C++1z.
729 `#677 <https://github.com/pybind/pybind11/pull/677>`_.
730
731* Improved ``py::capsule`` API. Can be used to implement cleanup
732 callbacks that are involved at module destruction time.
733 `#752 <https://github.com/pybind/pybind11/pull/752>`_.
734
735* Various minor improvements and fixes.
736 `#595 <https://github.com/pybind/pybind11/pull/595>`_,
737 `#588 <https://github.com/pybind/pybind11/pull/588>`_,
738 `#589 <https://github.com/pybind/pybind11/pull/589>`_,
739 `#603 <https://github.com/pybind/pybind11/pull/603>`_,
740 `#619 <https://github.com/pybind/pybind11/pull/619>`_,
741 `#648 <https://github.com/pybind/pybind11/pull/648>`_,
742 `#695 <https://github.com/pybind/pybind11/pull/695>`_,
743 `#720 <https://github.com/pybind/pybind11/pull/720>`_,
744 `#723 <https://github.com/pybind/pybind11/pull/723>`_,
745 `#729 <https://github.com/pybind/pybind11/pull/729>`_,
746 `#724 <https://github.com/pybind/pybind11/pull/724>`_,
747 `#742 <https://github.com/pybind/pybind11/pull/742>`_,
748 `#753 <https://github.com/pybind/pybind11/pull/753>`_.
Wenzel Jakoba9730be2017-01-06 14:18:44 +0100749
Wenzel Jakobf8dafe92017-01-04 15:09:49 +0100750v2.0.1 (Jan 4, 2017)
751-----------------------------------------------------
752
753* Fix pointer to reference error in type_caster on MSVC
754 `#583 <https://github.com/pybind/pybind11/pull/583>`_.
755
756* Fixed a segmentation in the test suite due to a typo
757 `cd7eac <https://github.com/pybind/pybind11/commit/cd7eac>`_.
758
Wenzel Jakobe33ef9c2017-01-01 13:55:06 +0100759v2.0.0 (Jan 1, 2017)
Wenzel Jakobed52f462016-12-26 13:18:26 +0100760-----------------------------------------------------
761
762* Fixed a reference counting regression affecting types with custom metaclasses
763 (introduced in v2.0.0-rc1).
764 `#571 <https://github.com/pybind/pybind11/pull/571>`_.
765
766* Quenched a CMake policy warning.
767 `#570 <https://github.com/pybind/pybind11/pull/570>`_.
768
Wenzel Jakobe33ef9c2017-01-01 13:55:06 +0100769v2.0.0-rc1 (Dec 23, 2016)
Wenzel Jakobf88af0c2016-06-22 13:52:31 +0200770-----------------------------------------------------
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200771
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100772The pybind11 developers are excited to issue a release candidate of pybind11
773with a subsequent v2.0.0 release planned in early January next year.
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200774
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100775An incredible amount of effort by went into pybind11 over the last ~5 months,
776leading to a release that is jam-packed with exciting new features and numerous
Wenzel Jakobf8dafe92017-01-04 15:09:49 +0100777usability improvements. The following list links PRs or individual commits
Wenzel Jakobed52f462016-12-26 13:18:26 +0100778whenever applicable.
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100779
780Happy Christmas!
781
782* Support for binding C++ class hierarchies that make use of multiple
783 inheritance. `#410 <https://github.com/pybind/pybind11/pull/410>`_.
784
785* PyPy support: pybind11 now supports nightly builds of PyPy and will
786 interoperate with the future 5.7 release. No code changes are necessary,
787 everything "just" works as usual. Note that we only target the Python 2.7
788 branch for now; support for 3.x will be added once its ``cpyext`` extension
Wenzel Jakobed52f462016-12-26 13:18:26 +0100789 support catches up. A few minor features remain unsupported for the time
790 being (notably dynamic attributes in custom types).
791 `#527 <https://github.com/pybind/pybind11/pull/527>`_.
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100792
luzpaz4b874612018-05-06 13:54:10 +0000793* Significant work on the documentation -- in particular, the monolithic
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100794 ``advanced.rst`` file was restructured into a easier to read hierarchical
795 organization. `#448 <https://github.com/pybind/pybind11/pull/448>`_.
796
797* Many NumPy-related improvements:
798
799 1. Object-oriented API to access and modify NumPy ``ndarray`` instances,
800 replicating much of the corresponding NumPy C API functionality.
801 `#402 <https://github.com/pybind/pybind11/pull/402>`_.
802
803 2. NumPy array ``dtype`` array descriptors are now first-class citizens and
804 are exposed via a new class ``py::dtype``.
805
806 3. Structured dtypes can be registered using the ``PYBIND11_NUMPY_DTYPE()``
807 macro. Special ``array`` constructors accepting dtype objects were also
808 added.
809
810 One potential caveat involving this change: format descriptor strings
811 should now be accessed via ``format_descriptor::format()`` (however, for
812 compatibility purposes, the old syntax ``format_descriptor::value`` will
813 still work for non-structured data types). `#308
814 <https://github.com/pybind/pybind11/pull/308>`_.
815
816 4. Further improvements to support structured dtypes throughout the system.
817 `#472 <https://github.com/pybind/pybind11/pull/472>`_,
818 `#474 <https://github.com/pybind/pybind11/pull/474>`_,
819 `#459 <https://github.com/pybind/pybind11/pull/459>`_,
820 `#453 <https://github.com/pybind/pybind11/pull/453>`_,
821 `#452 <https://github.com/pybind/pybind11/pull/452>`_, and
822 `#505 <https://github.com/pybind/pybind11/pull/505>`_.
823
824 5. Fast access operators. `#497 <https://github.com/pybind/pybind11/pull/497>`_.
825
826 6. Constructors for arrays whose storage is owned by another object.
827 `#440 <https://github.com/pybind/pybind11/pull/440>`_.
828
829 7. Added constructors for ``array`` and ``array_t`` explicitly accepting shape
830 and strides; if strides are not provided, they are deduced assuming
831 C-contiguity. Also added simplified constructors for 1-dimensional case.
832
833 8. Added buffer/NumPy support for ``char[N]`` and ``std::array<char, N>`` types.
834
835 9. Added ``memoryview`` wrapper type which is constructible from ``buffer_info``.
836
837* Eigen: many additional conversions and support for non-contiguous
838 arrays/slices.
839 `#427 <https://github.com/pybind/pybind11/pull/427>`_,
840 `#315 <https://github.com/pybind/pybind11/pull/315>`_,
841 `#316 <https://github.com/pybind/pybind11/pull/316>`_,
842 `#312 <https://github.com/pybind/pybind11/pull/312>`_, and
843 `#267 <https://github.com/pybind/pybind11/pull/267>`_
844
845* Incompatible changes in ``class_<...>::class_()``:
846
847 1. Declarations of types that provide access via the buffer protocol must
848 now include the ``py::buffer_protocol()`` annotation as an argument to
849 the ``class_`` constructor.
850
851 2. Declarations of types that require a custom metaclass (i.e. all classes
852 which include static properties via commands such as
853 ``def_readwrite_static()``) must now include the ``py::metaclass()``
854 annotation as an argument to the ``class_`` constructor.
855
856 These two changes were necessary to make type definitions in pybind11
857 future-proof, and to support PyPy via its cpyext mechanism. `#527
858 <https://github.com/pybind/pybind11/pull/527>`_.
859
860
luzpaz4b874612018-05-06 13:54:10 +0000861 3. This version of pybind11 uses a redesigned mechanism for instantiating
862 trampoline classes that are used to override virtual methods from within
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100863 Python. This led to the following user-visible syntax change: instead of
864
865 .. code-block:: cpp
866
867 py::class_<TrampolineClass>("MyClass")
868 .alias<MyClass>()
869 ....
870
871 write
872
873 .. code-block:: cpp
874
875 py::class_<MyClass, TrampolineClass>("MyClass")
876 ....
877
878 Importantly, both the original and the trampoline class are now
879 specified as an arguments (in arbitrary order) to the ``py::class_``
880 template, and the ``alias<..>()`` call is gone. The new scheme has zero
881 overhead in cases when Python doesn't override any functions of the
882 underlying C++ class. `rev. 86d825
883 <https://github.com/pybind/pybind11/commit/86d825>`_.
884
Wenzel Jakobe6b2f752016-07-10 10:54:46 +0200885* Added ``eval`` and ``eval_file`` functions for evaluating expressions and
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100886 statements from a string or file. `rev. 0d3fc3
887 <https://github.com/pybind/pybind11/commit/0d3fc3>`_.
888
889* pybind11 can now create types with a modifiable dictionary.
890 `#437 <https://github.com/pybind/pybind11/pull/437>`_ and
891 `#444 <https://github.com/pybind/pybind11/pull/444>`_.
892
893* Support for translation of arbitrary C++ exceptions to Python counterparts.
894 `#296 <https://github.com/pybind/pybind11/pull/296>`_ and
895 `#273 <https://github.com/pybind/pybind11/pull/273>`_.
896
897* Report full backtraces through mixed C++/Python code, better reporting for
898 import errors, fixed GIL management in exception processing.
899 `#537 <https://github.com/pybind/pybind11/pull/537>`_,
900 `#494 <https://github.com/pybind/pybind11/pull/494>`_,
901 `rev. e72d95 <https://github.com/pybind/pybind11/commit/e72d95>`_, and
902 `rev. 099d6e <https://github.com/pybind/pybind11/commit/099d6e>`_.
903
904* Support for bit-level operations, comparisons, and serialization of C++
905 enumerations. `#503 <https://github.com/pybind/pybind11/pull/503>`_,
906 `#508 <https://github.com/pybind/pybind11/pull/508>`_,
907 `#380 <https://github.com/pybind/pybind11/pull/380>`_,
908 `#309 <https://github.com/pybind/pybind11/pull/309>`_.
909 `#311 <https://github.com/pybind/pybind11/pull/311>`_.
910
911* The ``class_`` constructor now accepts its template arguments in any order.
912 `#385 <https://github.com/pybind/pybind11/pull/385>`_.
913
914* Attribute and item accessors now have a more complete interface which makes
915 it possible to chain attributes as in
916 ``obj.attr("a")[key].attr("b").attr("method")(1, 2, 3)``. `#425
917 <https://github.com/pybind/pybind11/pull/425>`_.
918
919* Major redesign of the default and conversion constructors in ``pytypes.h``.
920 `#464 <https://github.com/pybind/pybind11/pull/464>`_.
921
922* Added built-in support for ``std::shared_ptr`` holder type. It is no longer
923 necessary to to include a declaration of the form
924 ``PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`` (though continuing to
925 do so won't cause an error).
926 `#454 <https://github.com/pybind/pybind11/pull/454>`_.
927
928* New ``py::overload_cast`` casting operator to select among multiple possible
929 overloads of a function. An example:
930
931 .. code-block:: cpp
932
933 py::class_<Pet>(m, "Pet")
934 .def("set", py::overload_cast<int>(&Pet::set), "Set the pet's age")
935 .def("set", py::overload_cast<const std::string &>(&Pet::set), "Set the pet's name");
936
937 This feature only works on C++14-capable compilers.
938 `#541 <https://github.com/pybind/pybind11/pull/541>`_.
939
940* C++ types are automatically cast to Python types, e.g. when assigning
941 them as an attribute. For instance, the following is now legal:
942
943 .. code-block:: cpp
944
945 py::module m = /* ... */
946 m.attr("constant") = 123;
947
948 (Previously, a ``py::cast`` call was necessary to avoid a compilation error.)
949 `#551 <https://github.com/pybind/pybind11/pull/551>`_.
950
951* Redesigned ``pytest``-based test suite. `#321 <https://github.com/pybind/pybind11/pull/321>`_.
952
953* Instance tracking to detect reference leaks in test suite. `#324 <https://github.com/pybind/pybind11/pull/324>`_
954
955* pybind11 can now distinguish between multiple different instances that are
956 located at the same memory address, but which have different types.
957 `#329 <https://github.com/pybind/pybind11/pull/329>`_.
958
959* Improved logic in ``move`` return value policy.
960 `#510 <https://github.com/pybind/pybind11/pull/510>`_,
961 `#297 <https://github.com/pybind/pybind11/pull/297>`_.
962
963* Generalized unpacking API to permit calling Python functions from C++ using
964 notation such as ``foo(a1, a2, *args, "ka"_a=1, "kb"_a=2, **kwargs)``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
965
966* ``py::print()`` function whose behavior matches that of the native Python
967 ``print()`` function. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
968
969* Added ``py::dict`` keyword constructor:``auto d = dict("number"_a=42,
970 "name"_a="World");``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
971
972* Added ``py::str::format()`` method and ``_s`` literal: ``py::str s = "1 + 2
973 = {}"_s.format(3);``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
974
975* Added ``py::repr()`` function which is equivalent to Python's builtin
976 ``repr()``. `#333 <https://github.com/pybind/pybind11/pull/333>`_.
977
978* Improved construction and destruction logic for holder types. It is now
979 possible to reference instances with smart pointer holder types without
980 constructing the holder if desired. The ``PYBIND11_DECLARE_HOLDER_TYPE``
981 macro now accepts an optional second parameter to indicate whether the holder
982 type uses intrusive reference counting.
983 `#533 <https://github.com/pybind/pybind11/pull/533>`_ and
984 `#561 <https://github.com/pybind/pybind11/pull/561>`_.
985
986* Mapping a stateless C++ function to Python and back is now "for free" (i.e.
987 no extra indirections or argument conversion overheads). `rev. 954b79
988 <https://github.com/pybind/pybind11/commit/954b79>`_.
989
990* Bindings for ``std::valarray<T>``.
991 `#545 <https://github.com/pybind/pybind11/pull/545>`_.
992
993* Improved support for C++17 capable compilers.
994 `#562 <https://github.com/pybind/pybind11/pull/562>`_.
995
996* Bindings for ``std::optional<t>``.
997 `#475 <https://github.com/pybind/pybind11/pull/475>`_,
998 `#476 <https://github.com/pybind/pybind11/pull/476>`_,
999 `#479 <https://github.com/pybind/pybind11/pull/479>`_,
1000 `#499 <https://github.com/pybind/pybind11/pull/499>`_, and
1001 `#501 <https://github.com/pybind/pybind11/pull/501>`_.
1002
1003* ``stl_bind.h``: general improvements and support for ``std::map`` and
1004 ``std::unordered_map``.
1005 `#490 <https://github.com/pybind/pybind11/pull/490>`_,
1006 `#282 <https://github.com/pybind/pybind11/pull/282>`_,
1007 `#235 <https://github.com/pybind/pybind11/pull/235>`_.
1008
1009* The ``std::tuple``, ``std::pair``, ``std::list``, and ``std::vector`` type
1010 casters now accept any Python sequence type as input. `rev. 107285
1011 <https://github.com/pybind/pybind11/commit/107285>`_.
1012
1013* Improved CMake Python detection on multi-architecture Linux.
1014 `#532 <https://github.com/pybind/pybind11/pull/532>`_.
1015
1016* Infrastructure to selectively disable or enable parts of the automatically
1017 generated docstrings. `#486 <https://github.com/pybind/pybind11/pull/486>`_.
1018
1019* ``reference`` and ``reference_internal`` are now the default return value
1020 properties for static and non-static properties, respectively. `#473
1021 <https://github.com/pybind/pybind11/pull/473>`_. (the previous defaults
1022 were ``automatic``). `#473 <https://github.com/pybind/pybind11/pull/473>`_.
1023
1024* Support for ``std::unique_ptr`` with non-default deleters or no deleter at
1025 all (``py::nodelete``). `#384 <https://github.com/pybind/pybind11/pull/384>`_.
1026
Wenzel Jakob3c796712016-12-23 16:19:36 +01001027* Deprecated ``handle::call()`` method. The new syntax to call Python
1028 functions is simply ``handle()``. It can also be invoked explicitly via
Wenzel Jakobd3549d62016-12-23 16:01:04 +01001029 ``handle::operator<X>()``, where ``X`` is an optional return value policy.
1030
1031* Print more informative error messages when ``make_tuple()`` or ``cast()``
1032 fail. `#262 <https://github.com/pybind/pybind11/pull/262>`_.
1033
1034* Creation of holder types for classes deriving from
1035 ``std::enable_shared_from_this<>`` now also works for ``const`` values.
1036 `#260 <https://github.com/pybind/pybind11/pull/260>`_.
1037
1038* ``make_iterator()`` improvements for better compatibility with various
1039 types (now uses prefix increment operator); it now also accepts iterators
1040 with different begin/end types as long as they are equality comparable.
1041 `#247 <https://github.com/pybind/pybind11/pull/247>`_.
1042
1043* ``arg()`` now accepts a wider range of argument types for default values.
1044 `#244 <https://github.com/pybind/pybind11/pull/244>`_.
1045
1046* Support ``keep_alive`` where the nurse object may be ``None``. `#341
1047 <https://github.com/pybind/pybind11/pull/341>`_.
1048
1049* Added constructors for ``str`` and ``bytes`` from zero-terminated char
1050 pointers, and from char pointers and length. Added constructors for ``str``
1051 from ``bytes`` and for ``bytes`` from ``str``, which will perform UTF-8
1052 decoding/encoding as required.
1053
1054* Many other improvements of library internals without user-visible changes
1055
Wenzel Jakoba720a602016-07-12 18:02:13 +02001056
10571.8.1 (July 12, 2016)
1058----------------------
Wenzel Jakobc47d4982016-07-11 23:40:28 +02001059* Fixed a rare but potentially very severe issue when the garbage collector ran
1060 during pybind11 type creation.
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +02001061
Wenzel Jakobf9502152016-06-14 15:00:46 +020010621.8.0 (June 14, 2016)
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +02001063----------------------
1064* Redesigned CMake build system which exports a convenient
1065 ``pybind11_add_module`` function to parent projects.
1066* ``std::vector<>`` type bindings analogous to Boost.Python's ``indexing_suite``
1067* Transparent conversion of sparse and dense Eigen matrices and vectors (``eigen.h``)
1068* Added an ``ExtraFlags`` template argument to the NumPy ``array_t<>`` wrapper
1069 to disable an enforced cast that may lose precision, e.g. to create overloads
1070 for different precisions and complex vs real-valued matrices.
Wenzel Jakob3f200fa2016-05-17 15:35:29 +02001071* Prevent implicit conversion of floating point values to integral types in
1072 function arguments
Wenzel Jakob163ac2e2016-05-03 14:16:18 +02001073* Fixed incorrect default return value policy for functions returning a shared
1074 pointer
Wenzel Jakob38d8b8c2016-05-31 09:53:28 +02001075* Don't allow registering a type via ``class_`` twice
Wenzel Jakob163ac2e2016-05-03 14:16:18 +02001076* Don't allow casting a ``None`` value into a C++ lvalue reference
1077* Fixed a crash in ``enum_::operator==`` that was triggered by the ``help()`` command
1078* Improved detection of whether or not custom C++ types can be copy/move-constructed
1079* Extended ``str`` type to also work with ``bytes`` instances
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +02001080* Added a ``"name"_a`` user defined string literal that is equivalent to ``py::arg("name")``.
1081* When specifying function arguments via ``py::arg``, the test that verifies
1082 the number of arguments now runs at compile time.
Wenzel Jakob163ac2e2016-05-03 14:16:18 +02001083* Added ``[[noreturn]]`` attribute to ``pybind11_fail()`` to quench some
1084 compiler warnings
Wenzel Jakob86d825f2016-05-26 13:19:27 +02001085* List function arguments in exception text when the dispatch code cannot find
1086 a matching overload
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +02001087* Added ``PYBIND11_OVERLOAD_NAME`` and ``PYBIND11_OVERLOAD_PURE_NAME`` macros which
Wenzel Jakobf9502152016-06-14 15:00:46 +02001088 can be used to override virtual methods whose name differs in C++ and Python
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +02001089 (e.g. ``__call__`` and ``operator()``)
Wenzel Jakob163ac2e2016-05-03 14:16:18 +02001090* Various minor ``iterator`` and ``make_iterator()`` improvements
Wenzel Jakob86d825f2016-05-26 13:19:27 +02001091* Transparently support ``__bool__`` on Python 2.x and Python 3.x
1092* Fixed issue with destructor of unpickled object not being called
Wenzel Jakob163ac2e2016-05-03 14:16:18 +02001093* Minor CMake build system improvements on Windows
Wenzel Jakob86d825f2016-05-26 13:19:27 +02001094* New ``pybind11::args`` and ``pybind11::kwargs`` types to create functions which
1095 take an arbitrary number of arguments and keyword arguments
1096* New syntax to call a Python function from C++ using ``*args`` and ``*kwargs``
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +02001097* The functions ``def_property_*`` now correctly process docstring arguments (these
1098 formerly caused a segmentation fault)
1099* Many ``mkdoc.py`` improvements (enumerations, template arguments, ``DOC()``
1100 macro accepts more arguments)
1101* Cygwin support
1102* Documentation improvements (pickling support, ``keep_alive``, macro usage)
Wenzel Jakobc4d7ccd2016-04-30 22:00:44 +02001103
Wenzel Jakobe70b2ab2016-04-30 19:58:33 +020011041.7 (April 30, 2016)
Wenzel Jakobbb79d7b2016-04-21 12:23:20 +02001105----------------------
Wenzel Jakob1ac22e32016-04-25 23:25:40 +02001106* Added a new ``move`` return value policy that triggers C++11 move semantics.
Wenzel Jakobdd7ec342016-04-29 10:06:24 +02001107 The automatic return value policy falls back to this case whenever a rvalue
Wenzel Jakob1ac22e32016-04-25 23:25:40 +02001108 reference is encountered
Wenzel Jakobe84f5572016-04-26 23:19:19 +02001109* Significantly more general GIL state routines that are used instead of
1110 Python's troublesome ``PyGILState_Ensure`` and ``PyGILState_Release`` API
Wenzel Jakobdd7ec342016-04-29 10:06:24 +02001111* Redesign of opaque types that drastically simplifies their usage
Wenzel Jakobe70b2ab2016-04-30 19:58:33 +02001112* Extended ability to pass values of type ``[const] void *``
Wenzel Jakob1ac22e32016-04-25 23:25:40 +02001113* ``keep_alive`` fix: don't fail when there is no patient
Wenzel Jakobdd7ec342016-04-29 10:06:24 +02001114* ``functional.h``: acquire the GIL before calling a Python function
Wenzel Jakob1ac22e32016-04-25 23:25:40 +02001115* Added Python RAII type wrappers ``none`` and ``iterable``
1116* Added ``*args`` and ``*kwargs`` pass-through parameters to
1117 ``pybind11.get_include()`` function
Wenzel Jakobdd7ec342016-04-29 10:06:24 +02001118* Iterator improvements and fixes
1119* Documentation on return value policies and opaque types improved
Wenzel Jakobbb79d7b2016-04-21 12:23:20 +02001120
Wenzel Jakobe70b2ab2016-04-30 19:58:33 +020011211.6 (April 30, 2016)
1122----------------------
1123* Skipped due to upload to PyPI gone wrong and inability to recover
1124 (https://github.com/pypa/packaging-problems/issues/74)
1125
Wenzel Jakobbb79d7b2016-04-21 12:23:20 +020011261.5 (April 21, 2016)
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001127----------------------
Wenzel Jakobc79dbe42016-04-17 21:54:31 +02001128* For polymorphic types, use RTTI to try to return the closest type registered with pybind11
Wenzel Jakobd7efa4f2016-04-13 13:45:09 +02001129* Pickling support for serializing and unserializing C++ instances to a byte stream in Python
Wenzel Jakobb2825952016-04-13 23:33:00 +02001130* Added a convenience routine ``make_iterator()`` which turns a range indicated
1131 by a pair of C++ iterators into a iterable Python object
1132* Added ``len()`` and a variadic ``make_tuple()`` function
Wenzel Jakobb2b44a92016-04-15 17:50:40 +02001133* Addressed a rare issue that could confuse the current virtual function
1134 dispatcher and another that could lead to crashes in multi-threaded
1135 applications
Wenzel Jakobb2825952016-04-13 23:33:00 +02001136* Added a ``get_include()`` function to the Python module that returns the path
1137 of the directory containing the installed pybind11 header files
Wenzel Jakob1c329aa2016-04-13 02:37:36 +02001138* Documentation improvements: import issues, symbol visibility, pickling, limitations
Wenzel Jakobdbe43ff2016-04-21 12:21:14 +02001139* Added casting support for ``std::reference_wrapper<>``
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001140
Wenzel Jakob33c2a042016-04-07 09:06:49 +020011411.4 (April 7, 2016)
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001142--------------------------
Wenzel Jakob81dfd2c2016-03-08 19:40:32 +01001143* Transparent type conversion for ``std::wstring`` and ``wchar_t``
Wenzel Jakob0e6ca592016-04-07 08:49:37 +02001144* Allow passing ``nullptr``-valued strings
Wenzel Jakob34116732016-04-06 17:55:41 +02001145* Transparent passing of ``void *`` pointers using capsules
Wenzel Jakob0e6ca592016-04-07 08:49:37 +02001146* Transparent support for returning values wrapped in ``std::unique_ptr<>``
Wenzel Jakob4e455dd2016-03-09 16:38:28 +01001147* Improved docstring generation for compatibility with Sphinx
Wenzel Jakob34116732016-04-06 17:55:41 +02001148* Nicer debug error message when default parameter construction fails
1149* Support for "opaque" types that bypass the transparent conversion layer for STL containers
1150* Redesigned type casting interface to avoid ambiguities that could occasionally cause compiler errors
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001151* Redesigned property implementation; fixes crashes due to an unfortunate default return value policy
Wenzel Jakob4e455dd2016-03-09 16:38:28 +01001152* Anaconda package generation support
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001153
11541.3 (March 8, 2016)
Wenzel Jakob8ed28082016-02-07 17:32:37 +01001155--------------------------
Wenzel Jakobcf2b87a2016-02-22 17:32:44 +01001156
1157* Added support for the Intel C++ compiler (v15+)
1158* Added support for the STL unordered set/map data structures
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001159* Added support for the STL linked list data structure
Wenzel Jakobcf2b87a2016-02-22 17:32:44 +01001160* NumPy-style broadcasting support in ``pybind11::vectorize``
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001161* pybind11 now displays more verbose error messages when ``arg::operator=()`` fails
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001162* pybind11 internal data structures now live in a version-dependent namespace to avoid ABI issues
1163* Many, many bugfixes involving corner cases and advanced usage
Wenzel Jakob8ed28082016-02-07 17:32:37 +01001164
11651.2 (February 7, 2016)
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001166--------------------------
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001167
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001168* Optional: efficient generation of function signatures at compile time using C++14
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001169* Switched to a simpler and more general way of dealing with function default
1170 arguments. Unused keyword arguments in function calls are now detected and
1171 cause errors as expected
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001172* New ``keep_alive`` call policy analogous to Boost.Python's ``with_custodian_and_ward``
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001173* New ``pybind11::base<>`` attribute to indicate a subclass relationship
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001174* Improved interface for RAII type wrappers in ``pytypes.h``
1175* Use RAII type wrappers consistently within pybind11 itself. This
1176 fixes various potential refcount leaks when exceptions occur
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001177* Added new ``bytes`` RAII type wrapper (maps to ``string`` in Python 2.7)
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001178* Made handle and related RAII classes const correct, using them more
1179 consistently everywhere now
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001180* Got rid of the ugly ``__pybind11__`` attributes on the Python side---they are
1181 now stored in a C++ hash table that is not visible in Python
1182* Fixed refcount leaks involving NumPy arrays and bound functions
1183* Vastly improved handling of shared/smart pointers
1184* Removed an unnecessary copy operation in ``pybind11::vectorize``
1185* Fixed naming clashes when both pybind11 and NumPy headers are included
1186* Added conversions for additional exception types
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001187* Documentation improvements (using multiple extension modules, smart pointers,
1188 other minor clarifications)
Wenzel Jakob61587162016-01-18 22:38:52 +01001189* unified infrastructure for parsing variadic arguments in ``class_`` and cpp_function
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001190* Fixed license text (was: ZLIB, should have been: 3-clause BSD)
1191* Python 3.2 compatibility
Wenzel Jakobcd4e6ae2016-01-29 11:48:40 +01001192* Fixed remaining issues when accessing types in another plugin module
1193* Added enum comparison and casting methods
1194* Improved SFINAE-based detection of whether types are copy-constructible
1195* Eliminated many warnings about unused variables and the use of ``offsetof()``
Wenzel Jakob8ed28082016-02-07 17:32:37 +01001196* Support for ``std::array<>`` conversions
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001197
11981.1 (December 7, 2015)
1199--------------------------
1200
1201* Documentation improvements (GIL, wrapping functions, casting, fixed many typos)
1202* Generalized conversion of integer types
1203* Improved support for casting function objects
1204* Improved support for ``std::shared_ptr<>`` conversions
1205* Initial support for ``std::set<>`` conversions
1206* Fixed type resolution issue for types defined in a separate plugin module
1207* Cmake build system improvements
1208* Factored out generic functionality to non-templated code (smaller code size)
1209* Added a code size / compile time benchmark vs Boost.Python
1210* Added an appveyor CI script
1211
12121.0 (October 15, 2015)
1213------------------------
1214* Initial release