1Limitations 2########### 3 4Design choices 5^^^^^^^^^^^^^^ 6 7pybind11 strives to be a general solution to binding generation, but it also has 8certain limitations: 9 10- pybind11 casts away ``const``-ness in function arguments and return values. 11 This is in line with the Python language, which has no concept of ``const`` 12 values. This means that some additional care is needed to avoid bugs that 13 would be caught by the type checker in a traditional C++ program. 14 15- The NumPy interface ``pybind11::array`` greatly simplifies accessing 16 numerical data from C++ (and vice versa), but it's not a full-blown array 17 class like ``Eigen::Array`` or ``boost.multi_array``. ``Eigen`` objects are 18 directly supported, however, with ``pybind11/eigen.h``. 19 20Large but useful features could be implemented in pybind11 but would lead to a 21significant increase in complexity. Pybind11 strives to be simple and compact. 22Users who require large new features are encouraged to write an extension to 23pybind11; see `pybind11_json <https://github.com/pybind/pybind11_json>`_ for an 24example. 25 26 27Known bugs 28^^^^^^^^^^ 29 30These are issues that hopefully will one day be fixed, but currently are 31unsolved. If you know how to help with one of these issues, contributions 32are welcome! 33 34- Intel 20.2 is currently having an issue with the test suite. 35 `#2573 <https://github.com/pybind/pybind11/pull/2573>`_ 36 37- Debug mode Python does not support 1-5 tests in the test suite currently. 38 `#2422 <https://github.com/pybind/pybind11/pull/2422>`_ 39 40- PyPy3 7.3.1 and 7.3.2 have issues with several tests on 32-bit Windows. 41 42Known limitations 43^^^^^^^^^^^^^^^^^ 44 45These are issues that are probably solvable, but have not been fixed yet. A 46clean, well written patch would likely be accepted to solve them. 47 48- Type casters are not kept alive recursively. 49 `#2527 <https://github.com/pybind/pybind11/issues/2527>`_ 50 One consequence is that containers of ``char *`` are currently not supported. 51 `#2245 <https://github.com/pybind/pybind11/issues/2245>`_ 52 53- The ``cpptest`` does not run on Windows with Python 3.8 or newer, due to DLL 54 loader changes. User code that is correctly installed should not be affected. 55 `#2560 <https://github.com/pybind/pybind11/issue/2560>`_ 56 57Python 3.9.0 warning 58^^^^^^^^^^^^^^^^^^^^ 59 60Combining older versions of pybind11 (< 2.6.0) with Python on 3.9.0 will 61trigger undefined behavior that typically manifests as crashes during 62interpreter shutdown (but could also destroy your data. **You have been 63warned**). 64 65This issue has been 66`fixed in Python <https://github.com/python/cpython/pull/22670>`_. As a 67mitigation until 3.9.1 is released and commonly used, pybind11 (2.6.0 or newer) 68includes a temporary workaround specifically when Python 3.9.0 is detected at 69runtime, leaking about 50 bytes of memory when a callback function is garbage 70collected. For reference; the pybind11 test suite has about 2,000 such 71callbacks, but only 49 are garbage collected before the end-of-process. Wheels 72built with Python 3.9.0 will correctly avoid the leak when run in Python 3.9.1. 73