- 13 Jun, 2019 1 commit
-
-
Alexander Gagarin authored
* Fix casting of time points with non-system-clock duration on Windows Add explicit `time_point_cast` to time point with duration of system clock. Fixes Visual Studio compile error. * Add test case for custom time points casting
-
- 11 Jun, 2019 6 commits
-
-
Wenzel Jakob authored
-
sizmailov authored
-
Chris Rusby authored
-
Roland Dreier authored
In def_readonly and def_readwrite, there is an assertion that the member comes from the class or a base class: static_assert(std::is_base_of<C, type>::value, "..."); However, if C and type are the same type, is_base_of will still only be true if they are the same _non-union_ type. This means we can't define accessors for the members of a union type because of this assertion. Update the assertion to test std::is_same<C, type>::value || std::is_base_of<C, type>::value which will allow union types, or members of base classes. Also add a basic unit test for accessing unions. -
Alexander Gagarin authored
* Fix async Python functors invoking from multiple C++ threads (#1587) Ensure GIL is held during functor destruction. * Add async Python callbacks test that runs in separate Python thread
-
Axel Huebl authored
I found that the numpy array tests already contained an empty-shaped array test, but none with data in it. Following PEP 3118, scalars have an empty shape and ndim 0. This works already and is now also documented/covered by a test.
-
- 10 Jun, 2019 2 commits
-
-
luzpaz authored
-
Blake Thompson authored
* Added __contains__ to stl bindings for maps
-
- 12 May, 2019 1 commit
-
-
Yannick Jadoul authored
* Fixing order of arguments in call to PyErr_GivenExceptionMatches in pybind11::error_already_set.matches * Added tests on error_already_set::matches fix for exception base classes
-
- 06 Apr, 2019 1 commit
-
-
Henry Schreiner authored
* Fix warning that not including a cmake source or build dir will be a fatal error (it is now on newest CMakes) * Fixes appveyor * Travis uses CMake 3.9 for more than a year now * Travis dropped sudo: false in December * Dropping Sphinx 2 - clang7: Suppress self-assign warnings; fix missing virtual dtors - pypy: - Keep old version (newer stuff breaks) - Pin packages to extra index for speed - travis: - Make docker explicit; remove docker if not needed - Make commands more verbose (for debugging / repro) - Make Ubuntu dist explicit per job - Fix Windows - Add names to travis
-
- 04 Feb, 2019 3 commits
-
-
Wenzel Jakob authored
-
Guilhem Saurel authored
-
-
- 03 Jan, 2019 1 commit
-
-
Yannick Jadoul authored
-
- 01 Dec, 2018 1 commit
-
-
Borja Zarco authored
This avoids GIL deadlocking when pybind11 tries to acquire the GIL in a thread that already acquired it using standard Python API (e.g. when running from a Python thread).
-
- 16 Nov, 2018 1 commit
-
-
voxmea authored
* 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.
-
- 11 Nov, 2018 2 commits
-
-
Trevor Laughlin authored
* Check default holder -Recognize "std::unique_ptr<T, D>" as a default holder even if "D" doesn't match between base and derived holders * Add test for unique_ptr<T, D> change
-
Wenzel Jakob authored
Pybind11 provides a cast operator between opaque void* pointers on the C++ side and capsules on the Python side. The py::cast<void *> expression was not aware of this possibility and incorrectly triggered a compile-time assertion ("Unable to cast type to reference: value is local to type caster") that is now fixed.
-
- 09 Nov, 2018 3 commits
-
-
Wenzel Jakob authored
* Support C++17 aligned new statement This patch makes pybind11 aware of nonstandard alignment requirements in bound types and passes on this information to C++17 aligned 'new' operator. Pre-C++17, the behavior is unchanged.
-
Wenzel Jakob authored
-
Wenzel Jakob authored
This PR brings the std::array<> caster in sync with the other STL type casters: to accept an arbitrary sequence as input (rather than a list, which is too restrictive).
-
- 24 Oct, 2018 1 commit
-
-
Tarcísio Fischer authored
-
- 11 Oct, 2018 1 commit
-
-
Allan Leal authored
* 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
-
- 02 Oct, 2018 1 commit
-
-
Jason Rhinelander authored
-
- 25 Sep, 2018 1 commit
-
-
oremanj authored
* Fix potential crash when calling an overloaded function The crash would occur if: - dispatcher() uses two-pass logic (because the target is overloaded and some arguments support conversions) - the first pass (with conversions disabled) doesn't find any matching overload - the second pass does find a matching overload, but its return value can't be converted to Python The code for formatting the error message assumed `it` still pointed to the selected overload, but during the second-pass loop `it` was nullptr. Fix by setting `it` correctly if a second-pass call returns a nullptr `handle`. Add a new test that segfaults without this fix. * Make overload iteration const-correct so we don't have to iterate again on second-pass error * Change test_error_after_conversions dependencies to local classes/variables
-
- 11 Sep, 2018 5 commits
-
-
Wenzel Jakob authored
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.
-
Wenzel Jakob authored
object_api::operator[] has a powerful overload for py::handle that can accept slices, tuples (for NumPy), etc. Lists, sequences, and tuples provide their own specialized operator[], which unfortunately disables this functionality. This is accidental, and the purpose of this commit is to re-enable the more general behavior. This commit is tangentially related to the previous one in that it makes py::handle/py::object et al. behave more like their Python counterparts.
-
Wenzel Jakob authored
This commit revamps the object_api class so that it maps most C++ operators to their Python analogs. This makes it possible to, e.g. perform arithmetic using a py::int_ or py::array.
-
Krzysztof Fornalczyk authored
* check for already existing enum value added; added test * added enum value name to exception message * test for defining enum with multiple identical names moved to test_enum.cpp/py
-
Wenzel Jakob authored
-
- 29 Aug, 2018 2 commits
-
-
Wenzel Jakob authored
-
Justin Bassett authored
-
- 28 Aug, 2018 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
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)];
-
- 19 Jul, 2018 1 commit
-
-
Jason Rhinelander authored
Catch v2 changed the `run(...)` signature to take a `char *argv[]`, arguing partly that technically a `char *argv[]` type is the correct `main()` signature rather than `const char *argv[]`. Dropping the `const` here doesn't appear to cause any problems with catch v1 (tested against both the cmake-downloaded 1.9.3 and Debian's 1.12.1 package) so we can follow suit.
-
- 17 Jul, 2018 1 commit
-
-
Wenzel Jakob authored
* stl.h: propagate return value policies to type-specific casters Return value policies for containers like those handled in in 'stl.h' are currently broken. The problem is that detail::return_value_policy_override<C>::policy() always returns 'move' when given a non-pointer/reference type, e.g. 'std::vector<...>'. This is sensible behavior for custom types that are exposed via 'py::class_<>', but it does not make sense for types that are handled by other type casters (STL containers, Eigen matrices, etc.). This commit changes the behavior so that detail::return_value_policy_override only becomes active when the type caster derives from type_caster_generic. Furthermore, the override logic is called recursively in STL type casters to enable key/value-specific behavior.
-
- 24 Jun, 2018 1 commit
-
-
Khachajantc Michael authored
-
- 18 May, 2018 1 commit
-
-
Jason Rhinelander authored
Fixes #1401
-
- 06 May, 2018 1 commit
-
-
Naotoshi Seo authored
Fix a segfault when creating a 0-dimension, c-strides array.
-