Commit Graph

413 Commits

Author SHA1 Message Date
Eric Cousineau baf69345f6 Minor modifications to interrupt handling FAQ (#2007) 2019-11-25 22:14:06 +08:00
Charles Brossollet 0f1d3bfee2 Add FAQ entry for dealing with long functions interruption (#2000)
* Add FAQ entry, with code example, for dealing with long functions interruption
2019-11-25 17:59:53 +08:00
Francesco Biscani deb3cb238a Add exception translation for std::overflow_error. (#1977) 2019-11-14 08:56:58 +01:00
Erick Matsen b32b762c60 Fixing minor typo in basics.rst (#1984) 2019-11-14 08:54:46 +01:00
Wenzel Jakob dfde1554ea begin working on next version 2019-10-15 01:58:43 +02:00
Wenzel Jakob 80d452484c v2.4.3 release 2019-10-15 01:57:24 +02:00
Wenzel Jakob 34c2281e31 begin working on next version 2019-09-21 20:23:01 +02:00
Wenzel Jakob 2abd7e1eb4 updated release.rst to remove parts that are now automated 2019-09-21 20:22:33 +02:00
Wenzel Jakob 7ec2ddfc95 v2.4.2 release 2019-09-21 20:20:26 +02:00
Wenzel Jakob 82cf793588 begin working on next version 2019-09-20 11:12:22 +02:00
Wenzel Jakob e44fcc3c15 v2.4.1 release 2019-09-20 11:10:49 +02:00
Wenzel Jakob 5fd187ebe9 minor changelog cleanup
[ci skip]
2019-09-20 10:49:54 +02:00
Wenzel Jakob e825205ac6 begin working on v2.4.1 2019-09-19 23:18:04 +02:00
Wenzel Jakob 00a0aa9929 v2.4.0 release 2019-09-19 23:06:22 +02:00
Andre Schmeißer 19189b4c2c Make `overload_cast_impl` available in C++11 mode. (#1581)
* Make `overload_cast_impl` available in C++11 mode.

Narrow the scope of the `#if defined(PYBIND11_CPP14)` block around overload_cast to only
cover the parts where C++14 is stricly required. Thus, the implementation in
`pybind11::details::overload_cast_impl` is still available in C++11 mode.

* PR #1581: Modify test to use overload_cast_impl, update docs and change log
2019-08-19 12:54:33 +02:00
phil-zxx c6b699d9c2 Added ability to convert from datetime.date to system_clock::time_point (#1848)
* Added ability to convert from Python datetime.date and datetime.time to C++ system_clock::time_point
2019-07-19 11:28:48 +02:00
Ian Bell 502ffe50a9 Add docs and tests for unary op on class (#1814) 2019-06-22 12:07:41 +02:00
Wenzel Jakob 64f2a5f8e6 begin work on v2.3.1 2019-06-12 21:03:40 +02:00
Wenzel Jakob cf36e3d9ba updated changelog 2019-06-11 23:28:58 +02:00
Wenzel Jakob 51ca6b0832 Update docs on std::out_of_range exception mapping (#1254) 2019-06-11 23:28:58 +02:00
Chris Rusby 22859bb8fc Support more natural syntax for vector extend 2019-06-11 23:28:58 +02:00
Roland Dreier 7a24bcf1f6 Fix malformed reST (#1802)
Commit 2b045757b5 ("Improve documentation related to inheritance. (#1676)") left off
a ':' from a hyperlink, which breaks the Travis CI build.
2019-06-11 10:57:49 +02:00
Ivor Wanders 2b045757b5 Improve documentation related to inheritance. (#1676)
* Adds section to the reference.
* Adds section to advanced classes page describing how to use `get_overload`.
2019-06-10 22:12:28 +02:00
Manuel Schneider 492da592c2 another typo (#1675) 2019-06-10 22:05:12 +02:00
Darius Arnold 09330b94ea Fix typos in documentation (#1635)
* Always capitalize Eigen

* Fix spelling
2019-06-10 21:57:00 +02:00
Omar Awile ac6cb91a34 Fixed small typo (#1633)
I think this particular method binding should not be done with `PYBIND11_OVERLOAD_PURE` but instead `PYBIND11_OVERLOAD`.
2019-06-10 21:56:17 +02:00
Sergei Izmailov 979d75de23 doc: Add note about casting from `None` to `T*` (#1760)
* doc: Add note about casting from `None` to `T*`

* doc: reword 'none-to-pointer' note message

* doc: mention opaque types in 'none-to-pointer' note message
2019-06-10 21:03:17 +02:00
nstelzen c251434011 Added note in documentation regarding make install (#1801)
* Added note regarding make install
2019-06-10 16:35:36 +02:00
Wenzel Jakob 64205140bd added std::deque to overview.rst
[ci skip]
2018-11-16 06:46:48 +01:00
voxmea 17983e7425 Adds type_caster support for std::deque. (#1609)
* Adds std::deque to the types supported by list_caster in stl.h.
* Adds a new test_deque test in test_stl.{py,cpp}.
* Updates the documentation to include std::deque as a default
  supported type.
2018-11-16 06:45:19 +01:00
Ahuva Kroizer 8f5b7fce84 FAQ addition (#1606)
* Add possible solution to ImportError issue
2018-11-13 13:25:57 +01:00
Allan Leal e76dff7751 Fix for Issue #1258 (#1298)
* Fix for Issue #1258

list_caster::load method will now check for a Python string and prevent its automatic conversion to a list.
This should fix the issue "pybind11/stl.h converts string to vector<string> #1258" (https://github.com/pybind/pybind11/issues/1258)

* Added tests for fix of issue #1258

* Changelog: stl string auto-conversion
2018-10-11 10:28:12 +02:00
Semen Yesylevskyy ef13fb2e1c Info about inconsistent detection of Python version between pybind11 … (#1093)
* Info about inconsistent detection of Python version between pybind11 and CMake in FAQ
2018-09-12 00:20:56 +02:00
Wenzel Jakob f4245181ae enum_: move most functionality to a non-template implementation
This commit addresses an inefficiency in how enums are created in
pybind11. Most of the enum_<> implementation is completely generic --
however, being a template class, it ended up instantiating vast amounts
of essentially identical code in larger projects with many enums.

This commit introduces a generic non-templated helper class that is
compatible with any kind of enumeration. enum_ then becomes a thin
wrapper around this new class.

The new enum_<> API is designed to be 100% compatible with the old one.
2018-09-11 22:08:26 +02:00
Wenzel Jakob 35c82c7250 changelog for version 2.2.4 & features targeted for 2.3.0 2018-09-11 10:41:30 +02:00
Jeff VanOss 01839dce8d remove duplicate feature from list (#1476) 2018-09-11 10:39:17 +02:00
Axel Huebl 435dbdd114 add_module: allow include as SYSTEM (#1416)
pybind11 headers passed via the `pybind11_add_module` CMake
function can now be included as `SYSTEM` includes (`-isystem`).

This allows to set stricter (or experimental) warnings in
calling projects that might throw otherwise in headers
a user of pybind11 can not influence.
2018-08-29 13:20:11 +02:00
Wenzel Jakob d4b37a284a added py::ellipsis() method for slicing of multidimensional NumPy arrays
This PR adds a new py::ellipsis() method which can be used in
conjunction with NumPy's generalized slicing support. For instance,
the following is now valid (where "a" is a NumPy array):

py::array b = a[py::make_tuple(0, py::ellipsis(), 0)];
2018-08-28 23:22:55 +02:00
Boris Dalstein b30734ee9f Fix typo in doc: build-in -> built-in 2018-07-17 11:28:15 -03:00
Thomas Hrabe 534b756cb3 Minor documentation clarification in numpy.rst (#1356) 2018-06-24 15:41:27 +02:00
Antony Lee 55dc131944 Clarify docs for functions taking bytes and not str. 2018-05-24 11:09:41 -03:00
François Becker ce9d6e2c0d Fixed typo in classes.rst (#1388)
Fixed typos (erroneous `;`) in `classes.rst`.
2018-05-07 10:18:08 -03:00
luzpaz 4b874616b2 Misc. typos (#1384)
Found via `codespell`
2018-05-06 10:54:10 -03:00
Tom de Geus a7ff616dfb Simplified example allowing more robust usage, fixed minor spelling issues 2018-05-06 10:48:54 -03:00
Wenzel Jakob f5f6618962 updated changelog for v2.2.3 2018-04-29 15:47:13 +02:00
Lori A. Burns bdbe8d0bde Enforces intel icpc >= 2017, fixes #1121 (#1363) 2018-04-29 13:48:25 +02:00
David Caron 307ea6b7fd Typo 2018-04-24 17:44:57 -03:00
oremanj fd9bc8f54d Add basic support for tag-based static polymorphism (#1326)
* Add basic support for tag-based static polymorphism

Sometimes it is possible to look at a C++ object and know what its dynamic type is,
even if it doesn't use C++ polymorphism, because instances of the object and its
subclasses conform to some other mechanism for being self-describing; for example,
perhaps there's an enumerated "tag" or "kind" member in the base class that's always
set to an indication of the correct type. This might be done for performance reasons,
or to permit most-derived types to be trivially copyable. One of the most widely-known
examples is in LLVM: https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html

This PR permits pybind11 to be informed of such conventions via a new specializable
detail::polymorphic_type_hook<> template, which generalizes the previous logic for
determining the runtime type of an object based on C++ RTTI. Implementors provide
a way to map from a base class object to a const std::type_info* for the dynamic
type; pybind11 then uses this to ensure that casting a Base* to Python creates a
Python object that knows it's wrapping the appropriate sort of Derived.

There are a number of restrictions with this tag-based static polymorphism support
compared to pybind11's existing support for built-in C++ polymorphism:

- there is no support for this-pointer adjustment, so only single inheritance is permitted
- there is no way to make C++ code call new Python-provided subclasses
- when binding C++ classes that redefine a method in a subclass, the .def() must be
  repeated in the binding for Python to know about the update

But these are not much of an issue in practice in many cases, the impact on the
complexity of pybind11's innards is minimal and localized, and the support for
automatic downcasting improves usability a great deal.
2018-04-14 02:13:10 +02:00
Antony Lee 8fbb5594fd Clarify error_already_set documentation. 2018-04-09 16:25:04 -03:00
Boris Staletic 289e5d9cc2 Implement an enum_ property "name"
The property returns the enum_ value as a string.
For example:

>>> import module
>>> module.enum.VALUE
enum.VALUE
>>> str(module.enum.VALUE)
'enum.VALUE'
>>> module.enum.VALUE.name
'VALUE'

This is actually the equivalent of Boost.Python "name" property.
2018-04-07 19:11:35 -03:00