- 31 May, 2020 4 commits
-
-
Eric Cousineau authored
Add warnings about extending STL
-
Eric Cousineau authored
-
Eric Cousineau authored
Primarily for the ccmake curses GUI
-
Henry Schreiner authored
* Test on Python 3.9 beta * Pin Sphinx * Newer version of PyPy
-
- 26 Apr, 2020 4 commits
-
-
Nicholas Musolino authored
-
Sebastian Koslowski authored
-
Jason Rhinelander authored
This adds support for a `py::args_kw_only()` annotation that can be specified between `py::arg` annotations to indicate that any following arguments are keyword-only. This allows you to write: m.def("f", [](int a, int b) { /* ... */ }, py::arg("a"), py::args_kw_only(), py::arg("b")); and have it work like Python 3's: def f(a, *, b): # ... with respect to how `a` and `b` arguments are accepted (that is, `a` can be positional or by keyword; `b` can only be specified by keyword). -
Dustin Spicuzza authored
- Not currently supported on PyPy
-
- 14 Apr, 2020 1 commit
-
-
Ralf W. Grosse-Kunstleve authored
With this change, and cast.h as-is in master, test_tagbased_polymorphic.cpp fails to compile with the error message below. With the cast.h change in pull/2016, building and testing succeeds. cd pybind11/build/tests && /usr/bin/c++ -DPYBIND11_TEST_BOOST -DPYBIND11_TEST_EIGEN -Dpybind11_tests_EXPORTS -Ipybind11/include -I/usr/include/python3.7m -isystem /usr/include/eigen3 -Os -DNDEBUG -fPIC -fvisibility=hidden -std=c++2a -flto -fno-fat-lto-objects -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -o CMakeFiles/pybind11_tests.dir/test_tagbased_polymorphic.cpp.o -c pybind11/tests/test_tagbased_polymorphic.cpp In file included from pybind11/include/pybind11/attr.h:13, from pybind11/include/pybind11/pybind11.h:44, from pybind11/tests/pybind11_tests.h:2, from pybind11/tests/test_tagbased_polymorphic.cpp:10: pybind11/include/pybind11/cast.h: In instantiation of ‘static std::pair<const void*, const pybind11::detail::type_info*> pybind11::detail::type_caster_base<type>::src_and_type(const itype*) [with type = Animal; pybind11::detail::type_caster_base<type>::itype = Animal]’: pybind11/include/pybind11/cast.h:906:31: required from ‘static pybind11::handle pybind11::detail::type_caster_base<type>::cast_holder(const itype*, const void*) [with type = Animal; pybind11::detail::type_caster_base<type>::itype = Animal]’ pybind11/include/pybind11/cast.h:1566:51: required from ‘static pybind11::handle pybind11::detail::move_only_holder_caster<type, holder_type>::cast(holder_type&&, pybind11::return_value_policy, pybind11::handle) [with type = Animal; holder_type = std::unique_ptr<Animal>]’ pybind11/include/pybind11/stl.h:175:69: required from ‘static pybind11::handle pybind11::detail::list_caster<Type, Value>::cast(T&&, pybind11::return_value_policy, pybind11::handle) [with T = std::vector<std::unique_ptr<Animal> >; Type = std::vector<std::unique_ptr<Animal> >; Value = std::unique_ptr<Animal>]’ pybind11/include/pybind11/pybind11.h:159:43: required from ‘void pybind11::cpp_function::initialize(Func&&, Return (*)(Args ...), const Extra& ...) [with Func = std::vector<std::unique_ptr<Animal> > (*&)(); Return = std::vector<std::unique_ptr<Animal> >; Args = {}; Extra = {pybind11::name, pybind11::scope, pybind11::sibling}]’ pybind11/include/pybind11/pybind11.h:64:9: required from ‘pybind11::cpp_function::cpp_function(Return (*)(Args ...), const Extra& ...) [with Return = std::vector<std::unique_ptr<Animal> >; Args = {}; Extra = {pybind11::name, pybind11::scope, pybind11::sibling}]’ pybind11/include/pybind11/pybind11.h:819:22: required from ‘pybind11::module& pybind11::module::def(const char*, Func&&, const Extra& ...) [with Func = std::vector<std::unique_ptr<Animal> > (*)(); Extra = {}]’ pybind11/tests/test_tagbased_polymorphic.cpp:141:36: required from here pybind11/include/pybind11/cast.h:880:61: error: ambiguous template instantiation for ‘struct pybind11::polymorphic_type_hook<Animal, void>’ const void *vsrc = polymorphic_type_hook<itype>::get(src, instance_type); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ pybind11/include/pybind11/cast.h:844:8: note: candidates are: ‘template<class itype> struct pybind11::polymorphic_type_hook<itype, typename std::enable_if<std::is_polymorphic<_Tp>::value, void>::type> [with itype = Animal]’ struct polymorphic_type_hook<itype, detail::enable_if_t<std::is_polymorphic<itype>::value>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pybind11/tests/test_tagbased_polymorphic.cpp:115:12: note: ‘template<class itype> struct pybind11::polymorphic_type_hook<itype, typename std::enable_if<std::is_base_of<Animal, itype>::value, void>::type> [with itype = Animal]’ struct polymorphic_type_hook<itype, detail::enable_if_t<std::is_base_of<Animal, itype>::value>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from pybind11/include/pybind11/attr.h:13, from pybind11/include/pybind11/pybind11.h:44, from pybind11/tests/pybind11_tests.h:2, from pybind11/tests/test_tagbased_polymorphic.cpp:10: pybind11/include/pybind11/cast.h:880:61: error: incomplete type ‘pybind11::polymorphic_type_hook<Animal, void>’ used in nested name specifier const void *vsrc = polymorphic_type_hook<itype>::get(src, instance_type); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
-
- 17 Jan, 2020 1 commit
-
-
fwjavox authored
-
- 19 Dec, 2019 1 commit
-
-
Vemund Handeland authored
* Fix test build in C++20 * Add C++20 char8_t/u8string support
-
- 24 Nov, 2019 1 commit
-
-
Sebastian Koslowski authored
-
- 14 Nov, 2019 2 commits
-
-
Francesco Biscani authored
-
Yannick Jadoul authored
Fixing SystemError when nb_bool/nb_nonzero sets a Python exception in type_caster<bool>::load (#1976)
-
- 31 Oct, 2019 1 commit
-
-
Sebastian Gsänger authored
* test pair-copyability on C++17 upwards The stdlib falsely detects containers like M=std::map<T, U> as copyable, even when one of T and U is not copyable. Therefore we cannot rely on the stdlib dismissing std::pair<T, M> by itself, even on C++17. * fix is_copy_assignable bind_map used std::is_copy_assignable which suffers from the same problems as std::is_copy_constructible, therefore the same fix has been applied. * created tests for copyability
-
- 23 Oct, 2019 1 commit
-
-
Hans Dembinski authored
-
- 20 Sep, 2019 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 19 Sep, 2019 1 commit
-
-
Sergei Izmailov authored
* fix: Avoid conversion to `int_` rhs argument of enum eq/ne * test: compare unscoped enum with strings * suppress comparison to None warning * test unscoped enum arithmetic and comparision with unsupported type
-
- 04 Sep, 2019 1 commit
-
-
Lori A. Burns authored
-
- 27 Aug, 2019 1 commit
-
-
Stephen Larew authored
-
- 19 Aug, 2019 2 commits
-
-
kingofpayne authored
-
Andre Schmeißer authored
* 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
-
- 16 Aug, 2019 1 commit
-
-
Sergei Lebedev authored
Dynamically resolving __contains__ on each call is wasteful since set has a public PySet_Contains function.
-
- 15 Aug, 2019 1 commit
-
-
ali-beep authored
-
- 27 Jul, 2019 1 commit
-
-
Pauli Virtanen authored
PyArray_DescrFromType returns a new reference, not borrowed one
-
- 23 Jul, 2019 1 commit
-
-
Eric Cousineau authored
numpy: Add test for explicit dtype checks. At present, int64 + uint64 do not exactly match dtype(...).num
-
- 19 Jul, 2019 1 commit
-
-
phil-zxx authored
* Added ability to convert from Python datetime.date and datetime.time to C++ system_clock::time_point
-
- 18 Jul, 2019 1 commit
-
-
Jeremy Maitin-Shepard authored
-
- 15 Jul, 2019 2 commits
-
-
Saran Tunyasuvunakool authored
This is only necessary if `get_internals` is called for the first time in a given module when the running thread is in a GIL-released state. Fixes #1364
-
Igor Socec authored
* Test dtype field order in numpy dtype tests When running tests with NumPy 1.14 or later this test exposes the "invalid buffer descriptor" error reported in #1274. * Create dtype_ptr with ordered fields
-
- 06 Jul, 2019 1 commit
-
-
Wenzel Jakob authored
-
- 22 Jun, 2019 1 commit
-
-
Ian Bell authored
-
- 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.
-