blob: 606be413aa00bcf13b90eb8f7b18d1f10ef4f9b3 [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 Jakob8cf091a2017-08-31 14:01:08 +02009v2.3.0 (Not yet released)
10-----------------------------------------------------
11
Dean Moldovan56613942017-07-02 12:52:00 +020012* Significantly reduced module binary size (10-20%) when compiled in C++11 mode
13 with GCC/Clang, or in any mode with MSVC. Function signatures are now always
14 precomputed at compile time (this was previously only available in C++14 mode
15 for non-MSVC compilers).
16 `#934 <https://github.com/pybind/pybind11/pull/934>`_.
Wenzel Jakob8cf091a2017-08-31 14:01:08 +020017
Wenzel Jakob35c82c72018-09-11 10:08:48 +020018* Add basic support for tag-based static polymorphism, where classes
19 provide a method to returns the desired type of an instance.
20 `#1326 <https://github.com/pybind/pybind11/pull/1326>`_.
21
Ted Drain0a0758c2017-11-07 08:35:27 -080022* Added support for write only properties.
23 `#1144 <https://github.com/pybind/pybind11/pull/1144>`_.
24
Wenzel Jakobf4245182018-09-01 01:20:24 +020025* Python type wrappers (``py::handle``, ``py::object``, etc.)
26 now support map Python's number protocol onto C++ arithmetic
27 operators such as ``operator+``, ``operator/=``, etc.
28 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.
29
Wenzel Jakob35c82c72018-09-11 10:08:48 +020030* A number of improvements related to enumerations:
31
32 1. The ``enum_`` implementation was rewritten from scratch to reduce
33 code bloat. Rather than instantiating a full implementation for each
34 enumeration, most code is now contained in a generic base class.
35 `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.
36
37 2. The ``value()`` method of ``py::enum_`` now accepts an optional
38 docstring that will be shown in the documentation of the associated
39 enumeration. `#1160 <https://github.com/pybind/pybind11/pull/1160>`_.
40
41 3. check for already existing enum value and throw an error if present.
42 `#1453 <https://github.com/pybind/pybind11/pull/1453>`_.
43
44* added ``py::ellipsis()`` method for slicing of multidimensional NumPy arrays
45 `#1502 <https://github.com/pybind/pybind11/pull/1502>`_.
46
47* ``pybind11_add_module()``: allow including Python as a ``SYSTEM`` include path.
48 `#1416 <https://github.com/pybind/pybind11/pull/1416>`_.
49
Allan Leale76dff72018-10-11 10:28:12 +020050* ``pybind11/stl.h`` does not convert strings to ``vector<string>`` anymore.
51 `#1258 <https://github.com/pybind/pybind11/issues/1258>`_.
52
Wenzel Jakob35c82c72018-09-11 10:08:48 +020053v2.2.4 (September 11, 2018)
54-----------------------------------------------------
55
56* Use new Python 3.7 Thread Specific Storage (TSS) implementation if available.
57 `#1454 <https://github.com/pybind/pybind11/pull/1454>`_,
58 `#1517 <https://github.com/pybind/pybind11/pull/1517>`_.
59
60* Fixes for newer MSVC versions and C++17 mode.
61 `#1347 <https://github.com/pybind/pybind11/pull/1347>`_,
62 `#1462 <https://github.com/pybind/pybind11/pull/1462>`_.
63
64* Propagate return value policies to type-specific casters
65 when casting STL containers.
66 `#1455 <https://github.com/pybind/pybind11/pull/1455>`_.
67
68* Allow ostream-redirection of more than 1024 characters.
69 `#1479 <https://github.com/pybind/pybind11/pull/1479>`_.
70
71* Set ``Py_DEBUG`` define when compiling against a debug Python build.
72 `#1438 <https://github.com/pybind/pybind11/pull/1438>`_.
73
74* Untangle integer logic in number type caster to work for custom
75 types that may only be castable to a restricted set of builtin types.
76 `#1442 <https://github.com/pybind/pybind11/pull/1442>`_.
77
78* CMake build system: Remember Python version in cache file.
79 `#1434 <https://github.com/pybind/pybind11/pull/1434>`_.
80
81* Fix for custom smart pointers: use ``std::addressof`` to obtain holder
82 address instead of ``operator&``.
83 `#1435 <https://github.com/pybind/pybind11/pull/1435>`_.
84
85* Properly report exceptions thrown during module initialization.
86 `#1362 <https://github.com/pybind/pybind11/pull/1362>`_.
87
88* Fixed a segmentation fault when creating empty-shaped NumPy array.
89 `#1371 <https://github.com/pybind/pybind11/pull/1371>`_.
90
91* The version of Intel C++ compiler must be >= 2017, and this is now checked by
92 the header files. `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.
93
94* A few minor typo fixes and improvements to the test suite, and
95 patches that silence compiler warnings.
Wenzel Jakob6d190362017-11-16 22:24:36 +010096
Wenzel Jakobf5f66182018-04-29 15:47:03 +020097v2.2.3 (April 29, 2018)
98-----------------------------------------------------
99
100* The pybind11 header location detection was replaced by a new implementation
101 that no longer depends on ``pip`` internals (the recently released ``pip``
102 10 has restricted access to this API).
103 `#1190 <https://github.com/pybind/pybind11/pull/1190>`_.
104
105* Small adjustment to an implementation detail to work around a compiler segmentation fault in Clang 3.3/3.4.
106 `#1350 <https://github.com/pybind/pybind11/pull/1350>`_.
107
108* The minimal supported version of the Intel compiler was >= 17.0 since
109 pybind11 v2.1. This check is now explicit, and a compile-time error is raised
110 if the compiler meet the requirement.
111 `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.
112
113* Fixed an endianness-related fault in the test suite.
114 `#1287 <https://github.com/pybind/pybind11/pull/1287>`_.
Lori A. Burnsbdbe8d02018-04-29 07:48:25 -0400115
Wenzel Jakob2d0507d2018-02-07 11:05:41 +0100116v2.2.2 (February 7, 2018)
117-----------------------------------------------------
118
119* Fixed a segfault when combining embedded interpreter
120 shutdown/reinitialization with external loaded pybind11 modules.
121 `#1092 <https://github.com/pybind/pybind11/pull/1092>`_.
122
123* Eigen support: fixed a bug where Nx1/1xN numpy inputs couldn't be passed as
124 arguments to Eigen vectors (which for Eigen are simply compile-time fixed
125 Nx1/1xN matrices).
126 `#1106 <https://github.com/pybind/pybind11/pull/1106>`_.
127
128* Clarified to license by moving the licensing of contributions from
129 ``LICENSE`` into ``CONTRIBUTING.md``: the licensing of contributions is not
130 actually part of the software license as distributed. This isn't meant to be
131 a substantial change in the licensing of the project, but addresses concerns
132 that the clause made the license non-standard.
133 `#1109 <https://github.com/pybind/pybind11/issues/1109>`_.
134
135* Fixed a regression introduced in 2.1 that broke binding functions with lvalue
136 character literal arguments.
137 `#1128 <https://github.com/pybind/pybind11/pull/1128>`_.
138
139* MSVC: fix for compilation failures under /permissive-, and added the flag to
140 the appveyor test suite.
141 `#1155 <https://github.com/pybind/pybind11/pull/1155>`_.
142
143* Fixed ``__qualname__`` generation, and in turn, fixes how class names
144 (especially nested class names) are shown in generated docstrings.
145 `#1171 <https://github.com/pybind/pybind11/pull/1171>`_.
146
147* Updated the FAQ with a suggested project citation reference.
148 `#1189 <https://github.com/pybind/pybind11/pull/1189>`_.
149
150* Added fixes for deprecation warnings when compiled under C++17 with
151 ``-Wdeprecated`` turned on, and add ``-Wdeprecated`` to the test suite
152 compilation flags.
153 `#1191 <https://github.com/pybind/pybind11/pull/1191>`_.
154
155* Fixed outdated PyPI URLs in ``setup.py``.
156 `#1213 <https://github.com/pybind/pybind11/pull/1213>`_.
157
158* Fixed a refcount leak for arguments that end up in a ``py::args`` argument
159 for functions with both fixed positional and ``py::args`` arguments.
160 `#1216 <https://github.com/pybind/pybind11/pull/1216>`_.
161
162* Fixed a potential segfault resulting from possible premature destruction of
163 ``py::args``/``py::kwargs`` arguments with overloaded functions.
164 `#1223 <https://github.com/pybind/pybind11/pull/1223>`_.
165
166* Fixed ``del map[item]`` for a ``stl_bind.h`` bound stl map.
167 `#1229 <https://github.com/pybind/pybind11/pull/1229>`_.
168
169* Fixed a regression from v2.1.x where the aggregate initialization could
170 unintentionally end up at a constructor taking a templated
171 ``std::initializer_list<T>`` argument.
172 `#1249 <https://github.com/pybind/pybind11/pull/1249>`_.
173
174* Fixed an issue where calling a function with a keep_alive policy on the same
175 nurse/patient pair would cause the internal patient storage to needlessly
176 grow (unboundedly, if the nurse is long-lived).
177 `#1251 <https://github.com/pybind/pybind11/issues/1251>`_.
178
179* Various other minor fixes.
180
Wenzel Jakobf94d7592017-09-14 08:49:47 +0200181v2.2.1 (September 14, 2017)
Dean Moldovan7939f4b2017-09-04 13:49:19 +0200182-----------------------------------------------------
183
Dean Moldovan27680302017-09-13 19:04:25 +0200184* Added ``py::module::reload()`` member function for reloading a module.
185 `#1040 <https://github.com/pybind/pybind11/pull/1040>`_.
Dean Moldovanb0a0e4a2017-09-04 21:16:09 +0200186
Dean Moldovan953d2422017-09-10 16:53:02 +0200187* Fixed a reference leak in the number converter.
188 `#1078 <https://github.com/pybind/pybind11/pull/1078>`_.
189
Dean Moldovan27680302017-09-13 19:04:25 +0200190* Fixed compilation with Clang on host GCC < 5 (old libstdc++ which isn't fully
191 C++11 compliant). `#1062 <https://github.com/pybind/pybind11/pull/1062>`_.
192
Dean Moldovan3c4933c2017-09-01 21:42:20 +0200193* Fixed a regression where the automatic ``std::vector<bool>`` caster would
194 fail to compile. The same fix also applies to any container which returns
195 element proxies instead of references.
196 `#1053 <https://github.com/pybind/pybind11/pull/1053>`_.
197
Dean Moldovan7939f4b2017-09-04 13:49:19 +0200198* Fixed a regression where the ``py::keep_alive`` policy could not be applied
199 to constructors. `#1065 <https://github.com/pybind/pybind11/pull/1065>`_.
200
Dean Moldovan7b1de1e2017-09-03 01:31:47 +0200201* Fixed a nullptr dereference when loading a ``py::module_local`` type
202 that's only registered in an external module.
203 `#1058 <https://github.com/pybind/pybind11/pull/1058>`_.
204
Dean Moldovan27680302017-09-13 19:04:25 +0200205* Fixed implicit conversion of accessors to types derived from ``py::object``.
206 `#1076 <https://github.com/pybind/pybind11/pull/1076>`_.
207
208* The ``name`` in ``PYBIND11_MODULE(name, variable)`` can now be a macro.
209 `#1082 <https://github.com/pybind/pybind11/pull/1082>`_.
210
211* Relaxed overly strict ``py::pickle()`` check for matching get and set types.
212 `#1064 <https://github.com/pybind/pybind11/pull/1064>`_.
213
Dean Moldovan2b4477e2017-09-09 20:21:34 +0200214* Conversion errors now try to be more informative when it's likely that
215 a missing header is the cause (e.g. forgetting ``<pybind11/stl.h>``).
216 `#1077 <https://github.com/pybind/pybind11/pull/1077>`_.
217
Wenzel Jakob2a5a5ec2017-08-31 13:58:24 +0200218v2.2.0 (August 31, 2017)
Wenzel Jakobd405b1b2017-03-22 22:20:07 +0100219-----------------------------------------------------
220
Dean Moldovandb46a892017-08-13 22:25:15 +0200221* Support for embedding the Python interpreter. See the
222 :doc:`documentation page </advanced/embedding>` for a
223 full overview of the new features.
224 `#774 <https://github.com/pybind/pybind11/pull/774>`_,
225 `#889 <https://github.com/pybind/pybind11/pull/889>`_,
226 `#892 <https://github.com/pybind/pybind11/pull/892>`_,
227 `#920 <https://github.com/pybind/pybind11/pull/920>`_.
228
229 .. code-block:: cpp
230
231 #include <pybind11/embed.h>
232 namespace py = pybind11;
233
234 int main() {
235 py::scoped_interpreter guard{}; // start the interpreter and keep it alive
236
237 py::print("Hello, World!"); // use the Python API
238 }
239
240* Support for inheriting from multiple C++ bases in Python.
241 `#693 <https://github.com/pybind/pybind11/pull/693>`_.
242
243 .. code-block:: python
244
245 from cpp_module import CppBase1, CppBase2
246
247 class PyDerived(CppBase1, CppBase2):
248 def __init__(self):
249 CppBase1.__init__(self) # C++ bases must be initialized explicitly
250 CppBase2.__init__(self)
251
252* ``PYBIND11_MODULE`` is now the preferred way to create module entry points.
253 ``PYBIND11_PLUGIN`` is deprecated. See :ref:`macros` for details.
254 `#879 <https://github.com/pybind/pybind11/pull/879>`_.
255
256 .. code-block:: cpp
257
258 // new
259 PYBIND11_MODULE(example, m) {
260 m.def("add", [](int a, int b) { return a + b; });
261 }
262
263 // old
264 PYBIND11_PLUGIN(example) {
265 py::module m("example");
266 m.def("add", [](int a, int b) { return a + b; });
267 return m.ptr();
268 }
269
270* pybind11's headers and build system now more strictly enforce hidden symbol
271 visibility for extension modules. This should be seamless for most users,
Dean Moldovan1fb9df62017-08-18 19:26:49 +0200272 but see the :doc:`upgrade` if you use a custom build system.
273 `#995 <https://github.com/pybind/pybind11/pull/995>`_.
Dean Moldovandb46a892017-08-13 22:25:15 +0200274
275* Support for ``py::module_local`` types which allow multiple modules to
276 export the same C++ types without conflicts. This is useful for opaque
277 types like ``std::vector<int>``. ``py::bind_vector`` and ``py::bind_map``
278 now default to ``py::module_local`` if their elements are builtins or
279 local types. See :ref:`module_local` for details.
280 `#949 <https://github.com/pybind/pybind11/pull/949>`_,
281 `#981 <https://github.com/pybind/pybind11/pull/981>`_,
282 `#995 <https://github.com/pybind/pybind11/pull/995>`_,
283 `#997 <https://github.com/pybind/pybind11/pull/997>`_.
284
285* Custom constructors can now be added very easily using lambdas or factory
286 functions which return a class instance by value, pointer or holder. This
287 supersedes the old placement-new ``__init__`` technique.
288 See :ref:`custom_constructors` for details.
Dean Moldovan4c540442017-08-30 21:53:08 +0200289 `#805 <https://github.com/pybind/pybind11/pull/805>`_,
290 `#1014 <https://github.com/pybind/pybind11/pull/1014>`_.
Dean Moldovandb46a892017-08-13 22:25:15 +0200291
292 .. code-block:: cpp
293
294 struct Example {
295 Example(std::string);
296 };
297
298 py::class_<Example>(m, "Example")
299 .def(py::init<std::string>()) // existing constructor
300 .def(py::init([](int n) { // custom constructor
301 return std::make_unique<Example>(std::to_string(n));
302 }));
303
Dean Moldovan1e5a7da2017-08-24 01:53:15 +0200304* Similarly to custom constructors, pickling support functions are now bound
305 using the ``py::pickle()`` adaptor which improves type safety. See the
306 :doc:`upgrade` and :ref:`pickling` for details.
307 `#1038 <https://github.com/pybind/pybind11/pull/1038>`_.
308
Dean Moldovandb46a892017-08-13 22:25:15 +0200309* Builtin support for converting C++17 standard library types and general
310 conversion improvements:
311
312 1. C++17 ``std::variant`` is supported right out of the box. C++11/14
313 equivalents (e.g. ``boost::variant``) can also be added with a simple
314 user-defined specialization. See :ref:`cpp17_container_casters` for details.
315 `#811 <https://github.com/pybind/pybind11/pull/811>`_,
316 `#845 <https://github.com/pybind/pybind11/pull/845>`_,
317 `#989 <https://github.com/pybind/pybind11/pull/989>`_.
318
319 2. Out-of-the-box support for C++17 ``std::string_view``.
320 `#906 <https://github.com/pybind/pybind11/pull/906>`_.
321
322 3. Improved compatibility of the builtin ``optional`` converter.
323 `#874 <https://github.com/pybind/pybind11/pull/874>`_.
324
325 4. The ``bool`` converter now accepts ``numpy.bool_`` and types which
326 define ``__bool__`` (Python 3.x) or ``__nonzero__`` (Python 2.7).
327 `#925 <https://github.com/pybind/pybind11/pull/925>`_.
328
329 5. C++-to-Python casters are now more efficient and move elements out
330 of rvalue containers whenever possible.
331 `#851 <https://github.com/pybind/pybind11/pull/851>`_,
332 `#936 <https://github.com/pybind/pybind11/pull/936>`_,
333 `#938 <https://github.com/pybind/pybind11/pull/938>`_.
334
335 6. Fixed ``bytes`` to ``std::string/char*`` conversion on Python 3.
336 `#817 <https://github.com/pybind/pybind11/pull/817>`_.
337
338 7. Fixed lifetime of temporary C++ objects created in Python-to-C++ conversions.
339 `#924 <https://github.com/pybind/pybind11/pull/924>`_.
340
Henry Schreiner8b405052017-08-24 17:12:43 -0700341* Scope guard call policy for RAII types, e.g. ``py::call_guard<py::gil_scoped_release>()``,
342 ``py::call_guard<py::scoped_ostream_redirect>()``. See :ref:`call_policies` for details.
Dean Moldovandb46a892017-08-13 22:25:15 +0200343 `#740 <https://github.com/pybind/pybind11/pull/740>`_.
344
Henry Schreiner8b405052017-08-24 17:12:43 -0700345* Utility for redirecting C++ streams to Python (e.g. ``std::cout`` ->
346 ``sys.stdout``). Scope guard ``py::scoped_ostream_redirect`` in C++ and
347 a context manager in Python. See :ref:`ostream_redirect`.
348 `#1009 <https://github.com/pybind/pybind11/pull/1009>`_.
349
Dean Moldovandb46a892017-08-13 22:25:15 +0200350* Improved handling of types and exceptions across module boundaries.
351 `#915 <https://github.com/pybind/pybind11/pull/915>`_,
352 `#951 <https://github.com/pybind/pybind11/pull/951>`_,
353 `#995 <https://github.com/pybind/pybind11/pull/995>`_.
354
355* Fixed destruction order of ``py::keep_alive`` nurse/patient objects
356 in reference cycles.
357 `#856 <https://github.com/pybind/pybind11/pull/856>`_.
358
359* Numpy and buffer protocol related improvements:
360
361 1. Support for negative strides in Python buffer objects/numpy arrays. This
362 required changing integers from unsigned to signed for the related C++ APIs.
363 Note: If you have compiler warnings enabled, you may notice some new conversion
364 warnings after upgrading. These can be resolved with ``static_cast``.
365 `#782 <https://github.com/pybind/pybind11/pull/782>`_.
366
367 2. Support ``std::complex`` and arrays inside ``PYBIND11_NUMPY_DTYPE``.
368 `#831 <https://github.com/pybind/pybind11/pull/831>`_,
369 `#832 <https://github.com/pybind/pybind11/pull/832>`_.
370
371 3. Support for constructing ``py::buffer_info`` and ``py::arrays`` using
372 arbitrary containers or iterators instead of requiring a ``std::vector``.
373 `#788 <https://github.com/pybind/pybind11/pull/788>`_,
374 `#822 <https://github.com/pybind/pybind11/pull/822>`_,
375 `#860 <https://github.com/pybind/pybind11/pull/860>`_.
376
377 4. Explicitly check numpy version and require >= 1.7.0.
378 `#819 <https://github.com/pybind/pybind11/pull/819>`_.
379
380* Support for allowing/prohibiting ``None`` for specific arguments and improved
381 ``None`` overload resolution order. See :ref:`none_arguments` for details.
382 `#843 <https://github.com/pybind/pybind11/pull/843>`_.
383 `#859 <https://github.com/pybind/pybind11/pull/859>`_.
384
385* Added ``py::exec()`` as a shortcut for ``py::eval<py::eval_statements>()``
386 and support for C++11 raw string literals as input. See :ref:`eval`.
387 `#766 <https://github.com/pybind/pybind11/pull/766>`_,
388 `#827 <https://github.com/pybind/pybind11/pull/827>`_.
389
390* ``py::vectorize()`` ignores non-vectorizable arguments and supports
391 member functions.
392 `#762 <https://github.com/pybind/pybind11/pull/762>`_.
393
394* Support for bound methods as callbacks (``pybind11/functional.h``).
395 `#815 <https://github.com/pybind/pybind11/pull/815>`_.
396
397* Allow aliasing pybind11 methods: ``cls.attr("foo") = cls.attr("bar")``.
398 `#802 <https://github.com/pybind/pybind11/pull/802>`_.
399
400* Don't allow mixed static/non-static overloads.
401 `#804 <https://github.com/pybind/pybind11/pull/804>`_.
402
403* Fixed overriding static properties in derived classes.
404 `#784 <https://github.com/pybind/pybind11/pull/784>`_.
405
Dean Moldovan4c540442017-08-30 21:53:08 +0200406* Improved deduction of member functions of a derived class when its bases
407 aren't registered with pybind11.
Dean Moldovandb46a892017-08-13 22:25:15 +0200408 `#855 <https://github.com/pybind/pybind11/pull/855>`_.
409
410 .. code-block:: cpp
411
412 struct Base {
413 int foo() { return 42; }
414 }
415
416 struct Derived : Base {}
417
418 // Now works, but previously required also binding `Base`
419 py::class_<Derived>(m, "Derived")
420 .def("foo", &Derived::foo); // function is actually from `Base`
421
Wenzel Jakobb12a9d62017-08-23 16:30:56 +0200422* The implementation of ``py::init<>`` now uses C++11 brace initialization
423 syntax to construct instances, which permits binding implicit constructors of
424 aggregate types. `#1015 <https://github.com/pybind/pybind11/pull/1015>`_.
425
426 .. code-block:: cpp
427
428 struct Aggregate {
429 int a;
430 std::string b;
431 };
432
433 py::class_<Aggregate>(m, "Aggregate")
434 .def(py::init<int, const std::string &>());
435
Dean Moldovandb46a892017-08-13 22:25:15 +0200436* Fixed issues with multiple inheritance with offset base/derived pointers.
437 `#812 <https://github.com/pybind/pybind11/pull/812>`_,
438 `#866 <https://github.com/pybind/pybind11/pull/866>`_,
439 `#960 <https://github.com/pybind/pybind11/pull/960>`_.
440
Dean Moldovan4c540442017-08-30 21:53:08 +0200441* Fixed reference leak of type objects.
442 `#1030 <https://github.com/pybind/pybind11/pull/1030>`_.
443
Dean Moldovandb46a892017-08-13 22:25:15 +0200444* Improved support for the ``/std:c++14`` and ``/std:c++latest`` modes
445 on MSVC 2017.
446 `#841 <https://github.com/pybind/pybind11/pull/841>`_,
447 `#999 <https://github.com/pybind/pybind11/pull/999>`_.
448
449* Fixed detection of private operator new on MSVC.
450 `#893 <https://github.com/pybind/pybind11/pull/893>`_,
451 `#918 <https://github.com/pybind/pybind11/pull/918>`_.
452
453* Intel C++ compiler compatibility fixes.
454 `#937 <https://github.com/pybind/pybind11/pull/937>`_.
455
456* Fixed implicit conversion of `py::enum_` to integer types on Python 2.7.
457 `#821 <https://github.com/pybind/pybind11/pull/821>`_.
458
Bruce Merry37de2da2017-08-30 14:22:00 +0200459* Added ``py::hash`` to fetch the hash value of Python objects, and
460 ``.def(hash(py::self))`` to provide the C++ ``std::hash`` as the Python
461 ``__hash__`` method.
462 `#1034 <https://github.com/pybind/pybind11/pull/1034>`_.
463
Dean Moldovandb46a892017-08-13 22:25:15 +0200464* Fixed ``__truediv__`` on Python 2 and ``__itruediv__`` on Python 3.
465 `#867 <https://github.com/pybind/pybind11/pull/867>`_.
466
467* ``py::capsule`` objects now support the ``name`` attribute. This is useful
468 for interfacing with ``scipy.LowLevelCallable``.
469 `#902 <https://github.com/pybind/pybind11/pull/902>`_.
470
471* Fixed ``py::make_iterator``'s ``__next__()`` for past-the-end calls.
472 `#897 <https://github.com/pybind/pybind11/pull/897>`_.
473
474* Added ``error_already_set::matches()`` for checking Python exceptions.
475 `#772 <https://github.com/pybind/pybind11/pull/772>`_.
476
477* Deprecated ``py::error_already_set::clear()``. It's no longer needed
478 following a simplification of the ``py::error_already_set`` class.
479 `#954 <https://github.com/pybind/pybind11/pull/954>`_.
480
481* Deprecated ``py::handle::operator==()`` in favor of ``py::handle::is()``
482 `#825 <https://github.com/pybind/pybind11/pull/825>`_.
483
484* Deprecated ``py::object::borrowed``/``py::object::stolen``.
485 Use ``py::object::borrowed_t{}``/``py::object::stolen_t{}`` instead.
486 `#771 <https://github.com/pybind/pybind11/pull/771>`_.
487
Dean Moldovan4c540442017-08-30 21:53:08 +0200488* Changed internal data structure versioning to avoid conflicts between
489 modules compiled with different revisions of pybind11.
490 `#1012 <https://github.com/pybind/pybind11/pull/1012>`_.
491
Dean Moldovandb46a892017-08-13 22:25:15 +0200492* Additional compile-time and run-time error checking and more informative messages.
493 `#786 <https://github.com/pybind/pybind11/pull/786>`_,
494 `#794 <https://github.com/pybind/pybind11/pull/794>`_,
495 `#803 <https://github.com/pybind/pybind11/pull/803>`_.
496
497* Various minor improvements and fixes.
498 `#764 <https://github.com/pybind/pybind11/pull/764>`_,
499 `#791 <https://github.com/pybind/pybind11/pull/791>`_,
500 `#795 <https://github.com/pybind/pybind11/pull/795>`_,
501 `#840 <https://github.com/pybind/pybind11/pull/840>`_,
502 `#844 <https://github.com/pybind/pybind11/pull/844>`_,
503 `#846 <https://github.com/pybind/pybind11/pull/846>`_,
504 `#849 <https://github.com/pybind/pybind11/pull/849>`_,
505 `#858 <https://github.com/pybind/pybind11/pull/858>`_,
506 `#862 <https://github.com/pybind/pybind11/pull/862>`_,
507 `#871 <https://github.com/pybind/pybind11/pull/871>`_,
508 `#872 <https://github.com/pybind/pybind11/pull/872>`_,
509 `#881 <https://github.com/pybind/pybind11/pull/881>`_,
510 `#888 <https://github.com/pybind/pybind11/pull/888>`_,
511 `#899 <https://github.com/pybind/pybind11/pull/899>`_,
512 `#928 <https://github.com/pybind/pybind11/pull/928>`_,
513 `#931 <https://github.com/pybind/pybind11/pull/931>`_,
514 `#944 <https://github.com/pybind/pybind11/pull/944>`_,
515 `#950 <https://github.com/pybind/pybind11/pull/950>`_,
516 `#952 <https://github.com/pybind/pybind11/pull/952>`_,
517 `#962 <https://github.com/pybind/pybind11/pull/962>`_,
518 `#965 <https://github.com/pybind/pybind11/pull/965>`_,
519 `#970 <https://github.com/pybind/pybind11/pull/970>`_,
Dean Moldovandb46a892017-08-13 22:25:15 +0200520 `#978 <https://github.com/pybind/pybind11/pull/978>`_,
Dean Moldovan4c540442017-08-30 21:53:08 +0200521 `#979 <https://github.com/pybind/pybind11/pull/979>`_,
Wenzel Jakoba1041192017-08-28 16:35:32 +0200522 `#986 <https://github.com/pybind/pybind11/pull/986>`_,
Dean Moldovan4c540442017-08-30 21:53:08 +0200523 `#1020 <https://github.com/pybind/pybind11/pull/1020>`_,
524 `#1027 <https://github.com/pybind/pybind11/pull/1027>`_,
Wenzel Jakoba1041192017-08-28 16:35:32 +0200525 `#1037 <https://github.com/pybind/pybind11/pull/1037>`_.
Dean Moldovandb46a892017-08-13 22:25:15 +0200526
527* Testing improvements.
528 `#798 <https://github.com/pybind/pybind11/pull/798>`_,
529 `#882 <https://github.com/pybind/pybind11/pull/882>`_,
530 `#898 <https://github.com/pybind/pybind11/pull/898>`_,
531 `#900 <https://github.com/pybind/pybind11/pull/900>`_,
532 `#921 <https://github.com/pybind/pybind11/pull/921>`_,
533 `#923 <https://github.com/pybind/pybind11/pull/923>`_,
534 `#963 <https://github.com/pybind/pybind11/pull/963>`_.
535
Wenzel Jakobdb200952017-04-07 02:03:46 +0200536v2.1.1 (April 7, 2017)
537-----------------------------------------------------
538
539* Fixed minimum version requirement for MSVC 2015u3
540 `#773 <https://github.com/pybind/pybind11/pull/773>`_.
541
Wenzel Jakobd405b1b2017-03-22 22:20:07 +0100542v2.1.0 (March 22, 2017)
Wenzel Jakoba9730be2017-01-06 14:18:44 +0100543-----------------------------------------------------
544
Wenzel Jakob62e5fef2017-03-22 22:07:45 +0100545* pybind11 now performs function overload resolution in two phases. The first
546 phase only considers exact type matches, while the second allows for implicit
547 conversions to take place. A special ``noconvert()`` syntax can be used to
548 completely disable implicit conversions for specific arguments.
549 `#643 <https://github.com/pybind/pybind11/pull/643>`_,
550 `#634 <https://github.com/pybind/pybind11/pull/634>`_,
551 `#650 <https://github.com/pybind/pybind11/pull/650>`_.
552
553* Fixed a regression where static properties no longer worked with classes
554 using multiple inheritance. The ``py::metaclass`` attribute is no longer
555 necessary (and deprecated as of this release) when binding classes with
556 static properties.
557 `#679 <https://github.com/pybind/pybind11/pull/679>`_,
558
559* Classes bound using ``pybind11`` can now use custom metaclasses.
560 `#679 <https://github.com/pybind/pybind11/pull/679>`_,
561
562* ``py::args`` and ``py::kwargs`` can now be mixed with other positional
563 arguments when binding functions using pybind11.
564 `#611 <https://github.com/pybind/pybind11/pull/611>`_.
565
566* Improved support for C++11 unicode string and character types; added
567 extensive documentation regarding pybind11's string conversion behavior.
568 `#624 <https://github.com/pybind/pybind11/pull/624>`_,
569 `#636 <https://github.com/pybind/pybind11/pull/636>`_,
570 `#715 <https://github.com/pybind/pybind11/pull/715>`_.
571
572* pybind11 can now avoid expensive copies when converting Eigen arrays to NumPy
573 arrays (and vice versa). `#610 <https://github.com/pybind/pybind11/pull/610>`_.
574
575* The "fast path" in ``py::vectorize`` now works for any full-size group of C or
576 F-contiguous arrays. The non-fast path is also faster since it no longer performs
577 copies of the input arguments (except when type conversions are necessary).
578 `#610 <https://github.com/pybind/pybind11/pull/610>`_.
579
580* Added fast, unchecked access to NumPy arrays via a proxy object.
581 `#746 <https://github.com/pybind/pybind11/pull/746>`_.
582
Wenzel Jakob0d929382017-03-22 22:52:29 +0100583* Transparent support for class-specific ``operator new`` and
Wenzel Jakob62e5fef2017-03-22 22:07:45 +0100584 ``operator delete`` implementations.
585 `#755 <https://github.com/pybind/pybind11/pull/755>`_.
586
587* Slimmer and more efficient STL-compatible iterator interface for sequence types.
588 `#662 <https://github.com/pybind/pybind11/pull/662>`_.
589
590* Improved custom holder type support.
591 `#607 <https://github.com/pybind/pybind11/pull/607>`_.
592
593* ``nullptr`` to ``None`` conversion fixed in various builtin type casters.
594 `#732 <https://github.com/pybind/pybind11/pull/732>`_.
595
596* ``enum_`` now exposes its members via a special ``__members__`` attribute.
597 `#666 <https://github.com/pybind/pybind11/pull/666>`_.
598
599* ``std::vector`` bindings created using ``stl_bind.h`` can now optionally
600 implement the buffer protocol. `#488 <https://github.com/pybind/pybind11/pull/488>`_.
601
602* Automated C++ reference documentation using doxygen and breathe.
603 `#598 <https://github.com/pybind/pybind11/pull/598>`_.
604
605* Added minimum compiler version assertions.
606 `#727 <https://github.com/pybind/pybind11/pull/727>`_.
607
608* Improved compatibility with C++1z.
609 `#677 <https://github.com/pybind/pybind11/pull/677>`_.
610
611* Improved ``py::capsule`` API. Can be used to implement cleanup
612 callbacks that are involved at module destruction time.
613 `#752 <https://github.com/pybind/pybind11/pull/752>`_.
614
615* Various minor improvements and fixes.
616 `#595 <https://github.com/pybind/pybind11/pull/595>`_,
617 `#588 <https://github.com/pybind/pybind11/pull/588>`_,
618 `#589 <https://github.com/pybind/pybind11/pull/589>`_,
619 `#603 <https://github.com/pybind/pybind11/pull/603>`_,
620 `#619 <https://github.com/pybind/pybind11/pull/619>`_,
621 `#648 <https://github.com/pybind/pybind11/pull/648>`_,
622 `#695 <https://github.com/pybind/pybind11/pull/695>`_,
623 `#720 <https://github.com/pybind/pybind11/pull/720>`_,
624 `#723 <https://github.com/pybind/pybind11/pull/723>`_,
625 `#729 <https://github.com/pybind/pybind11/pull/729>`_,
626 `#724 <https://github.com/pybind/pybind11/pull/724>`_,
627 `#742 <https://github.com/pybind/pybind11/pull/742>`_,
628 `#753 <https://github.com/pybind/pybind11/pull/753>`_.
Wenzel Jakoba9730be2017-01-06 14:18:44 +0100629
Wenzel Jakobf8dafe92017-01-04 15:09:49 +0100630v2.0.1 (Jan 4, 2017)
631-----------------------------------------------------
632
633* Fix pointer to reference error in type_caster on MSVC
634 `#583 <https://github.com/pybind/pybind11/pull/583>`_.
635
636* Fixed a segmentation in the test suite due to a typo
637 `cd7eac <https://github.com/pybind/pybind11/commit/cd7eac>`_.
638
Wenzel Jakobe33ef9c2017-01-01 13:55:06 +0100639v2.0.0 (Jan 1, 2017)
Wenzel Jakobed52f462016-12-26 13:18:26 +0100640-----------------------------------------------------
641
642* Fixed a reference counting regression affecting types with custom metaclasses
643 (introduced in v2.0.0-rc1).
644 `#571 <https://github.com/pybind/pybind11/pull/571>`_.
645
646* Quenched a CMake policy warning.
647 `#570 <https://github.com/pybind/pybind11/pull/570>`_.
648
Wenzel Jakobe33ef9c2017-01-01 13:55:06 +0100649v2.0.0-rc1 (Dec 23, 2016)
Wenzel Jakobf88af0c2016-06-22 13:52:31 +0200650-----------------------------------------------------
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200651
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100652The pybind11 developers are excited to issue a release candidate of pybind11
653with a subsequent v2.0.0 release planned in early January next year.
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200654
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100655An incredible amount of effort by went into pybind11 over the last ~5 months,
656leading to a release that is jam-packed with exciting new features and numerous
Wenzel Jakobf8dafe92017-01-04 15:09:49 +0100657usability improvements. The following list links PRs or individual commits
Wenzel Jakobed52f462016-12-26 13:18:26 +0100658whenever applicable.
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100659
660Happy Christmas!
661
662* Support for binding C++ class hierarchies that make use of multiple
663 inheritance. `#410 <https://github.com/pybind/pybind11/pull/410>`_.
664
665* PyPy support: pybind11 now supports nightly builds of PyPy and will
666 interoperate with the future 5.7 release. No code changes are necessary,
667 everything "just" works as usual. Note that we only target the Python 2.7
668 branch for now; support for 3.x will be added once its ``cpyext`` extension
Wenzel Jakobed52f462016-12-26 13:18:26 +0100669 support catches up. A few minor features remain unsupported for the time
670 being (notably dynamic attributes in custom types).
671 `#527 <https://github.com/pybind/pybind11/pull/527>`_.
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100672
luzpaz4b874612018-05-06 13:54:10 +0000673* Significant work on the documentation -- in particular, the monolithic
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100674 ``advanced.rst`` file was restructured into a easier to read hierarchical
675 organization. `#448 <https://github.com/pybind/pybind11/pull/448>`_.
676
677* Many NumPy-related improvements:
678
679 1. Object-oriented API to access and modify NumPy ``ndarray`` instances,
680 replicating much of the corresponding NumPy C API functionality.
681 `#402 <https://github.com/pybind/pybind11/pull/402>`_.
682
683 2. NumPy array ``dtype`` array descriptors are now first-class citizens and
684 are exposed via a new class ``py::dtype``.
685
686 3. Structured dtypes can be registered using the ``PYBIND11_NUMPY_DTYPE()``
687 macro. Special ``array`` constructors accepting dtype objects were also
688 added.
689
690 One potential caveat involving this change: format descriptor strings
691 should now be accessed via ``format_descriptor::format()`` (however, for
692 compatibility purposes, the old syntax ``format_descriptor::value`` will
693 still work for non-structured data types). `#308
694 <https://github.com/pybind/pybind11/pull/308>`_.
695
696 4. Further improvements to support structured dtypes throughout the system.
697 `#472 <https://github.com/pybind/pybind11/pull/472>`_,
698 `#474 <https://github.com/pybind/pybind11/pull/474>`_,
699 `#459 <https://github.com/pybind/pybind11/pull/459>`_,
700 `#453 <https://github.com/pybind/pybind11/pull/453>`_,
701 `#452 <https://github.com/pybind/pybind11/pull/452>`_, and
702 `#505 <https://github.com/pybind/pybind11/pull/505>`_.
703
704 5. Fast access operators. `#497 <https://github.com/pybind/pybind11/pull/497>`_.
705
706 6. Constructors for arrays whose storage is owned by another object.
707 `#440 <https://github.com/pybind/pybind11/pull/440>`_.
708
709 7. Added constructors for ``array`` and ``array_t`` explicitly accepting shape
710 and strides; if strides are not provided, they are deduced assuming
711 C-contiguity. Also added simplified constructors for 1-dimensional case.
712
713 8. Added buffer/NumPy support for ``char[N]`` and ``std::array<char, N>`` types.
714
715 9. Added ``memoryview`` wrapper type which is constructible from ``buffer_info``.
716
717* Eigen: many additional conversions and support for non-contiguous
718 arrays/slices.
719 `#427 <https://github.com/pybind/pybind11/pull/427>`_,
720 `#315 <https://github.com/pybind/pybind11/pull/315>`_,
721 `#316 <https://github.com/pybind/pybind11/pull/316>`_,
722 `#312 <https://github.com/pybind/pybind11/pull/312>`_, and
723 `#267 <https://github.com/pybind/pybind11/pull/267>`_
724
725* Incompatible changes in ``class_<...>::class_()``:
726
727 1. Declarations of types that provide access via the buffer protocol must
728 now include the ``py::buffer_protocol()`` annotation as an argument to
729 the ``class_`` constructor.
730
731 2. Declarations of types that require a custom metaclass (i.e. all classes
732 which include static properties via commands such as
733 ``def_readwrite_static()``) must now include the ``py::metaclass()``
734 annotation as an argument to the ``class_`` constructor.
735
736 These two changes were necessary to make type definitions in pybind11
737 future-proof, and to support PyPy via its cpyext mechanism. `#527
738 <https://github.com/pybind/pybind11/pull/527>`_.
739
740
luzpaz4b874612018-05-06 13:54:10 +0000741 3. This version of pybind11 uses a redesigned mechanism for instantiating
742 trampoline classes that are used to override virtual methods from within
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100743 Python. This led to the following user-visible syntax change: instead of
744
745 .. code-block:: cpp
746
747 py::class_<TrampolineClass>("MyClass")
748 .alias<MyClass>()
749 ....
750
751 write
752
753 .. code-block:: cpp
754
755 py::class_<MyClass, TrampolineClass>("MyClass")
756 ....
757
758 Importantly, both the original and the trampoline class are now
759 specified as an arguments (in arbitrary order) to the ``py::class_``
760 template, and the ``alias<..>()`` call is gone. The new scheme has zero
761 overhead in cases when Python doesn't override any functions of the
762 underlying C++ class. `rev. 86d825
763 <https://github.com/pybind/pybind11/commit/86d825>`_.
764
Wenzel Jakobe6b2f752016-07-10 10:54:46 +0200765* Added ``eval`` and ``eval_file`` functions for evaluating expressions and
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100766 statements from a string or file. `rev. 0d3fc3
767 <https://github.com/pybind/pybind11/commit/0d3fc3>`_.
768
769* pybind11 can now create types with a modifiable dictionary.
770 `#437 <https://github.com/pybind/pybind11/pull/437>`_ and
771 `#444 <https://github.com/pybind/pybind11/pull/444>`_.
772
773* Support for translation of arbitrary C++ exceptions to Python counterparts.
774 `#296 <https://github.com/pybind/pybind11/pull/296>`_ and
775 `#273 <https://github.com/pybind/pybind11/pull/273>`_.
776
777* Report full backtraces through mixed C++/Python code, better reporting for
778 import errors, fixed GIL management in exception processing.
779 `#537 <https://github.com/pybind/pybind11/pull/537>`_,
780 `#494 <https://github.com/pybind/pybind11/pull/494>`_,
781 `rev. e72d95 <https://github.com/pybind/pybind11/commit/e72d95>`_, and
782 `rev. 099d6e <https://github.com/pybind/pybind11/commit/099d6e>`_.
783
784* Support for bit-level operations, comparisons, and serialization of C++
785 enumerations. `#503 <https://github.com/pybind/pybind11/pull/503>`_,
786 `#508 <https://github.com/pybind/pybind11/pull/508>`_,
787 `#380 <https://github.com/pybind/pybind11/pull/380>`_,
788 `#309 <https://github.com/pybind/pybind11/pull/309>`_.
789 `#311 <https://github.com/pybind/pybind11/pull/311>`_.
790
791* The ``class_`` constructor now accepts its template arguments in any order.
792 `#385 <https://github.com/pybind/pybind11/pull/385>`_.
793
794* Attribute and item accessors now have a more complete interface which makes
795 it possible to chain attributes as in
796 ``obj.attr("a")[key].attr("b").attr("method")(1, 2, 3)``. `#425
797 <https://github.com/pybind/pybind11/pull/425>`_.
798
799* Major redesign of the default and conversion constructors in ``pytypes.h``.
800 `#464 <https://github.com/pybind/pybind11/pull/464>`_.
801
802* Added built-in support for ``std::shared_ptr`` holder type. It is no longer
803 necessary to to include a declaration of the form
804 ``PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`` (though continuing to
805 do so won't cause an error).
806 `#454 <https://github.com/pybind/pybind11/pull/454>`_.
807
808* New ``py::overload_cast`` casting operator to select among multiple possible
809 overloads of a function. An example:
810
811 .. code-block:: cpp
812
813 py::class_<Pet>(m, "Pet")
814 .def("set", py::overload_cast<int>(&Pet::set), "Set the pet's age")
815 .def("set", py::overload_cast<const std::string &>(&Pet::set), "Set the pet's name");
816
817 This feature only works on C++14-capable compilers.
818 `#541 <https://github.com/pybind/pybind11/pull/541>`_.
819
820* C++ types are automatically cast to Python types, e.g. when assigning
821 them as an attribute. For instance, the following is now legal:
822
823 .. code-block:: cpp
824
825 py::module m = /* ... */
826 m.attr("constant") = 123;
827
828 (Previously, a ``py::cast`` call was necessary to avoid a compilation error.)
829 `#551 <https://github.com/pybind/pybind11/pull/551>`_.
830
831* Redesigned ``pytest``-based test suite. `#321 <https://github.com/pybind/pybind11/pull/321>`_.
832
833* Instance tracking to detect reference leaks in test suite. `#324 <https://github.com/pybind/pybind11/pull/324>`_
834
835* pybind11 can now distinguish between multiple different instances that are
836 located at the same memory address, but which have different types.
837 `#329 <https://github.com/pybind/pybind11/pull/329>`_.
838
839* Improved logic in ``move`` return value policy.
840 `#510 <https://github.com/pybind/pybind11/pull/510>`_,
841 `#297 <https://github.com/pybind/pybind11/pull/297>`_.
842
843* Generalized unpacking API to permit calling Python functions from C++ using
844 notation such as ``foo(a1, a2, *args, "ka"_a=1, "kb"_a=2, **kwargs)``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
845
846* ``py::print()`` function whose behavior matches that of the native Python
847 ``print()`` function. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
848
849* Added ``py::dict`` keyword constructor:``auto d = dict("number"_a=42,
850 "name"_a="World");``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
851
852* Added ``py::str::format()`` method and ``_s`` literal: ``py::str s = "1 + 2
853 = {}"_s.format(3);``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.
854
855* Added ``py::repr()`` function which is equivalent to Python's builtin
856 ``repr()``. `#333 <https://github.com/pybind/pybind11/pull/333>`_.
857
858* Improved construction and destruction logic for holder types. It is now
859 possible to reference instances with smart pointer holder types without
860 constructing the holder if desired. The ``PYBIND11_DECLARE_HOLDER_TYPE``
861 macro now accepts an optional second parameter to indicate whether the holder
862 type uses intrusive reference counting.
863 `#533 <https://github.com/pybind/pybind11/pull/533>`_ and
864 `#561 <https://github.com/pybind/pybind11/pull/561>`_.
865
866* Mapping a stateless C++ function to Python and back is now "for free" (i.e.
867 no extra indirections or argument conversion overheads). `rev. 954b79
868 <https://github.com/pybind/pybind11/commit/954b79>`_.
869
870* Bindings for ``std::valarray<T>``.
871 `#545 <https://github.com/pybind/pybind11/pull/545>`_.
872
873* Improved support for C++17 capable compilers.
874 `#562 <https://github.com/pybind/pybind11/pull/562>`_.
875
876* Bindings for ``std::optional<t>``.
877 `#475 <https://github.com/pybind/pybind11/pull/475>`_,
878 `#476 <https://github.com/pybind/pybind11/pull/476>`_,
879 `#479 <https://github.com/pybind/pybind11/pull/479>`_,
880 `#499 <https://github.com/pybind/pybind11/pull/499>`_, and
881 `#501 <https://github.com/pybind/pybind11/pull/501>`_.
882
883* ``stl_bind.h``: general improvements and support for ``std::map`` and
884 ``std::unordered_map``.
885 `#490 <https://github.com/pybind/pybind11/pull/490>`_,
886 `#282 <https://github.com/pybind/pybind11/pull/282>`_,
887 `#235 <https://github.com/pybind/pybind11/pull/235>`_.
888
889* The ``std::tuple``, ``std::pair``, ``std::list``, and ``std::vector`` type
890 casters now accept any Python sequence type as input. `rev. 107285
891 <https://github.com/pybind/pybind11/commit/107285>`_.
892
893* Improved CMake Python detection on multi-architecture Linux.
894 `#532 <https://github.com/pybind/pybind11/pull/532>`_.
895
896* Infrastructure to selectively disable or enable parts of the automatically
897 generated docstrings. `#486 <https://github.com/pybind/pybind11/pull/486>`_.
898
899* ``reference`` and ``reference_internal`` are now the default return value
900 properties for static and non-static properties, respectively. `#473
901 <https://github.com/pybind/pybind11/pull/473>`_. (the previous defaults
902 were ``automatic``). `#473 <https://github.com/pybind/pybind11/pull/473>`_.
903
904* Support for ``std::unique_ptr`` with non-default deleters or no deleter at
905 all (``py::nodelete``). `#384 <https://github.com/pybind/pybind11/pull/384>`_.
906
Wenzel Jakob3c796712016-12-23 16:19:36 +0100907* Deprecated ``handle::call()`` method. The new syntax to call Python
908 functions is simply ``handle()``. It can also be invoked explicitly via
Wenzel Jakobd3549d62016-12-23 16:01:04 +0100909 ``handle::operator<X>()``, where ``X`` is an optional return value policy.
910
911* Print more informative error messages when ``make_tuple()`` or ``cast()``
912 fail. `#262 <https://github.com/pybind/pybind11/pull/262>`_.
913
914* Creation of holder types for classes deriving from
915 ``std::enable_shared_from_this<>`` now also works for ``const`` values.
916 `#260 <https://github.com/pybind/pybind11/pull/260>`_.
917
918* ``make_iterator()`` improvements for better compatibility with various
919 types (now uses prefix increment operator); it now also accepts iterators
920 with different begin/end types as long as they are equality comparable.
921 `#247 <https://github.com/pybind/pybind11/pull/247>`_.
922
923* ``arg()`` now accepts a wider range of argument types for default values.
924 `#244 <https://github.com/pybind/pybind11/pull/244>`_.
925
926* Support ``keep_alive`` where the nurse object may be ``None``. `#341
927 <https://github.com/pybind/pybind11/pull/341>`_.
928
929* Added constructors for ``str`` and ``bytes`` from zero-terminated char
930 pointers, and from char pointers and length. Added constructors for ``str``
931 from ``bytes`` and for ``bytes`` from ``str``, which will perform UTF-8
932 decoding/encoding as required.
933
934* Many other improvements of library internals without user-visible changes
935
Wenzel Jakoba720a602016-07-12 18:02:13 +0200936
9371.8.1 (July 12, 2016)
938----------------------
Wenzel Jakobc47d4982016-07-11 23:40:28 +0200939* Fixed a rare but potentially very severe issue when the garbage collector ran
940 during pybind11 type creation.
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200941
Wenzel Jakobf9502152016-06-14 15:00:46 +02009421.8.0 (June 14, 2016)
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200943----------------------
944* Redesigned CMake build system which exports a convenient
945 ``pybind11_add_module`` function to parent projects.
946* ``std::vector<>`` type bindings analogous to Boost.Python's ``indexing_suite``
947* Transparent conversion of sparse and dense Eigen matrices and vectors (``eigen.h``)
948* Added an ``ExtraFlags`` template argument to the NumPy ``array_t<>`` wrapper
949 to disable an enforced cast that may lose precision, e.g. to create overloads
950 for different precisions and complex vs real-valued matrices.
Wenzel Jakob3f200fa2016-05-17 15:35:29 +0200951* Prevent implicit conversion of floating point values to integral types in
952 function arguments
Wenzel Jakob163ac2e2016-05-03 14:16:18 +0200953* Fixed incorrect default return value policy for functions returning a shared
954 pointer
Wenzel Jakob38d8b8c2016-05-31 09:53:28 +0200955* Don't allow registering a type via ``class_`` twice
Wenzel Jakob163ac2e2016-05-03 14:16:18 +0200956* Don't allow casting a ``None`` value into a C++ lvalue reference
957* Fixed a crash in ``enum_::operator==`` that was triggered by the ``help()`` command
958* Improved detection of whether or not custom C++ types can be copy/move-constructed
959* Extended ``str`` type to also work with ``bytes`` instances
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200960* Added a ``"name"_a`` user defined string literal that is equivalent to ``py::arg("name")``.
961* When specifying function arguments via ``py::arg``, the test that verifies
962 the number of arguments now runs at compile time.
Wenzel Jakob163ac2e2016-05-03 14:16:18 +0200963* Added ``[[noreturn]]`` attribute to ``pybind11_fail()`` to quench some
964 compiler warnings
Wenzel Jakob86d825f2016-05-26 13:19:27 +0200965* List function arguments in exception text when the dispatch code cannot find
966 a matching overload
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200967* Added ``PYBIND11_OVERLOAD_NAME`` and ``PYBIND11_OVERLOAD_PURE_NAME`` macros which
Wenzel Jakobf9502152016-06-14 15:00:46 +0200968 can be used to override virtual methods whose name differs in C++ and Python
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200969 (e.g. ``__call__`` and ``operator()``)
Wenzel Jakob163ac2e2016-05-03 14:16:18 +0200970* Various minor ``iterator`` and ``make_iterator()`` improvements
Wenzel Jakob86d825f2016-05-26 13:19:27 +0200971* Transparently support ``__bool__`` on Python 2.x and Python 3.x
972* Fixed issue with destructor of unpickled object not being called
Wenzel Jakob163ac2e2016-05-03 14:16:18 +0200973* Minor CMake build system improvements on Windows
Wenzel Jakob86d825f2016-05-26 13:19:27 +0200974* New ``pybind11::args`` and ``pybind11::kwargs`` types to create functions which
975 take an arbitrary number of arguments and keyword arguments
976* New syntax to call a Python function from C++ using ``*args`` and ``*kwargs``
Wenzel Jakob1cbe7ef2016-06-14 14:55:10 +0200977* The functions ``def_property_*`` now correctly process docstring arguments (these
978 formerly caused a segmentation fault)
979* Many ``mkdoc.py`` improvements (enumerations, template arguments, ``DOC()``
980 macro accepts more arguments)
981* Cygwin support
982* Documentation improvements (pickling support, ``keep_alive``, macro usage)
Wenzel Jakobc4d7ccd2016-04-30 22:00:44 +0200983
Wenzel Jakobe70b2ab2016-04-30 19:58:33 +02009841.7 (April 30, 2016)
Wenzel Jakobbb79d7b2016-04-21 12:23:20 +0200985----------------------
Wenzel Jakob1ac22e32016-04-25 23:25:40 +0200986* Added a new ``move`` return value policy that triggers C++11 move semantics.
Wenzel Jakobdd7ec342016-04-29 10:06:24 +0200987 The automatic return value policy falls back to this case whenever a rvalue
Wenzel Jakob1ac22e32016-04-25 23:25:40 +0200988 reference is encountered
Wenzel Jakobe84f5572016-04-26 23:19:19 +0200989* Significantly more general GIL state routines that are used instead of
990 Python's troublesome ``PyGILState_Ensure`` and ``PyGILState_Release`` API
Wenzel Jakobdd7ec342016-04-29 10:06:24 +0200991* Redesign of opaque types that drastically simplifies their usage
Wenzel Jakobe70b2ab2016-04-30 19:58:33 +0200992* Extended ability to pass values of type ``[const] void *``
Wenzel Jakob1ac22e32016-04-25 23:25:40 +0200993* ``keep_alive`` fix: don't fail when there is no patient
Wenzel Jakobdd7ec342016-04-29 10:06:24 +0200994* ``functional.h``: acquire the GIL before calling a Python function
Wenzel Jakob1ac22e32016-04-25 23:25:40 +0200995* Added Python RAII type wrappers ``none`` and ``iterable``
996* Added ``*args`` and ``*kwargs`` pass-through parameters to
997 ``pybind11.get_include()`` function
Wenzel Jakobdd7ec342016-04-29 10:06:24 +0200998* Iterator improvements and fixes
999* Documentation on return value policies and opaque types improved
Wenzel Jakobbb79d7b2016-04-21 12:23:20 +02001000
Wenzel Jakobe70b2ab2016-04-30 19:58:33 +020010011.6 (April 30, 2016)
1002----------------------
1003* Skipped due to upload to PyPI gone wrong and inability to recover
1004 (https://github.com/pypa/packaging-problems/issues/74)
1005
Wenzel Jakobbb79d7b2016-04-21 12:23:20 +020010061.5 (April 21, 2016)
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001007----------------------
Wenzel Jakobc79dbe42016-04-17 21:54:31 +02001008* For polymorphic types, use RTTI to try to return the closest type registered with pybind11
Wenzel Jakobd7efa4f2016-04-13 13:45:09 +02001009* Pickling support for serializing and unserializing C++ instances to a byte stream in Python
Wenzel Jakobb2825952016-04-13 23:33:00 +02001010* Added a convenience routine ``make_iterator()`` which turns a range indicated
1011 by a pair of C++ iterators into a iterable Python object
1012* Added ``len()`` and a variadic ``make_tuple()`` function
Wenzel Jakobb2b44a92016-04-15 17:50:40 +02001013* Addressed a rare issue that could confuse the current virtual function
1014 dispatcher and another that could lead to crashes in multi-threaded
1015 applications
Wenzel Jakobb2825952016-04-13 23:33:00 +02001016* Added a ``get_include()`` function to the Python module that returns the path
1017 of the directory containing the installed pybind11 header files
Wenzel Jakob1c329aa2016-04-13 02:37:36 +02001018* Documentation improvements: import issues, symbol visibility, pickling, limitations
Wenzel Jakobdbe43ff2016-04-21 12:21:14 +02001019* Added casting support for ``std::reference_wrapper<>``
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001020
Wenzel Jakob33c2a042016-04-07 09:06:49 +020010211.4 (April 7, 2016)
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001022--------------------------
Wenzel Jakob81dfd2c2016-03-08 19:40:32 +01001023* Transparent type conversion for ``std::wstring`` and ``wchar_t``
Wenzel Jakob0e6ca592016-04-07 08:49:37 +02001024* Allow passing ``nullptr``-valued strings
Wenzel Jakob34116732016-04-06 17:55:41 +02001025* Transparent passing of ``void *`` pointers using capsules
Wenzel Jakob0e6ca592016-04-07 08:49:37 +02001026* Transparent support for returning values wrapped in ``std::unique_ptr<>``
Wenzel Jakob4e455dd2016-03-09 16:38:28 +01001027* Improved docstring generation for compatibility with Sphinx
Wenzel Jakob34116732016-04-06 17:55:41 +02001028* Nicer debug error message when default parameter construction fails
1029* Support for "opaque" types that bypass the transparent conversion layer for STL containers
1030* Redesigned type casting interface to avoid ambiguities that could occasionally cause compiler errors
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001031* Redesigned property implementation; fixes crashes due to an unfortunate default return value policy
Wenzel Jakob4e455dd2016-03-09 16:38:28 +01001032* Anaconda package generation support
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001033
10341.3 (March 8, 2016)
Wenzel Jakob8ed28082016-02-07 17:32:37 +01001035--------------------------
Wenzel Jakobcf2b87a2016-02-22 17:32:44 +01001036
1037* Added support for the Intel C++ compiler (v15+)
1038* Added support for the STL unordered set/map data structures
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001039* Added support for the STL linked list data structure
Wenzel Jakobcf2b87a2016-02-22 17:32:44 +01001040* NumPy-style broadcasting support in ``pybind11::vectorize``
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001041* pybind11 now displays more verbose error messages when ``arg::operator=()`` fails
Wenzel Jakobd2385e82016-03-08 18:04:43 +01001042* pybind11 internal data structures now live in a version-dependent namespace to avoid ABI issues
1043* Many, many bugfixes involving corner cases and advanced usage
Wenzel Jakob8ed28082016-02-07 17:32:37 +01001044
10451.2 (February 7, 2016)
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001046--------------------------
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001047
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001048* Optional: efficient generation of function signatures at compile time using C++14
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001049* Switched to a simpler and more general way of dealing with function default
1050 arguments. Unused keyword arguments in function calls are now detected and
1051 cause errors as expected
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001052* New ``keep_alive`` call policy analogous to Boost.Python's ``with_custodian_and_ward``
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001053* New ``pybind11::base<>`` attribute to indicate a subclass relationship
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001054* Improved interface for RAII type wrappers in ``pytypes.h``
1055* Use RAII type wrappers consistently within pybind11 itself. This
1056 fixes various potential refcount leaks when exceptions occur
Wenzel Jakob2c5d5602016-04-11 18:46:11 +02001057* Added new ``bytes`` RAII type wrapper (maps to ``string`` in Python 2.7)
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001058* Made handle and related RAII classes const correct, using them more
1059 consistently everywhere now
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001060* Got rid of the ugly ``__pybind11__`` attributes on the Python side---they are
1061 now stored in a C++ hash table that is not visible in Python
1062* Fixed refcount leaks involving NumPy arrays and bound functions
1063* Vastly improved handling of shared/smart pointers
1064* Removed an unnecessary copy operation in ``pybind11::vectorize``
1065* Fixed naming clashes when both pybind11 and NumPy headers are included
1066* Added conversions for additional exception types
Wenzel Jakob48548ea2016-01-17 22:36:44 +01001067* Documentation improvements (using multiple extension modules, smart pointers,
1068 other minor clarifications)
Wenzel Jakob61587162016-01-18 22:38:52 +01001069* unified infrastructure for parsing variadic arguments in ``class_`` and cpp_function
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001070* Fixed license text (was: ZLIB, should have been: 3-clause BSD)
1071* Python 3.2 compatibility
Wenzel Jakobcd4e6ae2016-01-29 11:48:40 +01001072* Fixed remaining issues when accessing types in another plugin module
1073* Added enum comparison and casting methods
1074* Improved SFINAE-based detection of whether types are copy-constructible
1075* Eliminated many warnings about unused variables and the use of ``offsetof()``
Wenzel Jakob8ed28082016-02-07 17:32:37 +01001076* Support for ``std::array<>`` conversions
Wenzel Jakob1ae77fe2016-01-17 22:36:43 +01001077
10781.1 (December 7, 2015)
1079--------------------------
1080
1081* Documentation improvements (GIL, wrapping functions, casting, fixed many typos)
1082* Generalized conversion of integer types
1083* Improved support for casting function objects
1084* Improved support for ``std::shared_ptr<>`` conversions
1085* Initial support for ``std::set<>`` conversions
1086* Fixed type resolution issue for types defined in a separate plugin module
1087* Cmake build system improvements
1088* Factored out generic functionality to non-templated code (smaller code size)
1089* Added a code size / compile time benchmark vs Boost.Python
1090* Added an appveyor CI script
1091
10921.0 (October 15, 2015)
1093------------------------
1094* Initial release