- 20 Oct, 2016 4 commits
-
-
Dean Moldovan authored
-
Wenzel Jakob authored
Auto-implement format/numpy descriptors for enum types
-
Ivan Smirnov authored
-
Ivan Smirnov authored
-
- 17 Oct, 2016 2 commits
-
-
Wenzel Jakob authored
Make operator bool() explicit
-
Dean Moldovan authored
This prevents unwanted conversions to bool or int such as: ``` py::object my_object; std::cout << my_object << std::endl; // compiles and prints 0 or 1 int n = my_object; // compiles and is nonsense ``` With `explicit operator bool()` the above cases become compiler errors.
-
- 16 Oct, 2016 2 commits
-
-
Wenzel Jakob authored
Disable most implicit conversion constructors
-
Jason Rhinelander authored
We have various classes that have non-explicit constructors that accept a single argument, which is implicitly making them implicitly convertible from the argument. In a few cases, this is desirable (e.g. implicit conversion of std::string to py::str, or conversion of double to py::float_); in many others, however, it is unintended (e.g. implicit conversion of size_t to some pre-declared py::array_t<T> type). This disables most of the unwanted implicit conversions by marking them `explicit`, and comments the ones that are deliberately left implicit.
-
- 15 Oct, 2016 2 commits
-
-
Wenzel Jakob authored
Accept any sequence type as std::vector (or std::list)
-
Pim Schellart authored
Accept any sequence type as std::vector
-
- 14 Oct, 2016 3 commits
-
-
Wenzel Jakob authored
Fix dynamic attribute inheritance in C++
-
Dean Moldovan authored
`PyType_Ready` would usually perform the inheritance for us, but it can't adjust `tp_basicsize` appropriately.
-
Wenzel Jakob authored
Add dynamic attribute support
-
- 13 Oct, 2016 6 commits
-
-
Dean Moldovan authored
-
Wenzel Jakob authored
This convenience function ensures that a py::object is either a py::array, or the implementation will try to convert it into one. Layout requirements (such as c_style or f_style) can be also be provided.
-
Dean Moldovan authored
-
Wenzel Jakob authored
Permit creation of NumPy arrays with a "base" object that owns the data
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 12 Oct, 2016 3 commits
-
-
Wenzel Jakob authored
This patch adds an extra base handle parameter to most ``py::array`` and ``py::array_t<>`` constructors. If specified along with a pointer to data, the base object will be registered within NumPy, which increases the base's reference count. This feature is useful to create shallow copies of C++ or Python arrays while ensuring that the owners of the underlying can't be garbage collected while referenced by NumPy. The commit also adds a simple test function involving a ``wrap()`` function that creates shallow copies of various N-D arrays.
-
Wenzel Jakob authored
- This actually works with no changes, I just wasn't 100% convinced and decided to write a test to see if it's true.
-
Pim Schellart authored
-
- 11 Oct, 2016 1 commit
-
-
Dean Moldovan authored
-
- 09 Oct, 2016 6 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
Wenzel Jakob authored
extra python version sanity check at import time
-
Wenzel Jakob authored
Python 3.5 can often import pybind11 modules compiled compiled for Python 3.4 (i.e. all symbols can be resolved), but this leads to crashes later on due to changes in various Python-internal data structures. This commit adds an extra sanity check to prevent a successful import when the Python versions don't match.
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 08 Oct, 2016 1 commit
-
-
Wenzel Jakob authored
This fixes an issue that can arise when forwarding (*args, **kwargs) captured from a pybind11-bound function call to another Python function. When the initial function call includes no keyword arguments, the py::kwargs field is set to nullptr and causes a crash later on.
-
- 07 Oct, 2016 1 commit
-
-
Wenzel Jakob authored
-
- 02 Oct, 2016 2 commits
-
-
Wenzel Jakob authored
Re-add accessor bool operator
-
Jason Rhinelander authored
PR #425 removed the bool operator from attribute accessors. This is likely in use by existing code as it was the only way before #425 added the `hasattr` function to check for the existence of an attribute, via: if (obj.attr("foo")) { ... } This commit adds it back in for attr and item accessors, but with a deprecation warning to use `hasattr(obj, ...)` or `obj.contains(...)` instead.
-
- 30 Sep, 2016 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 29 Sep, 2016 3 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
Simplify base class detection for Eigen types
-
Dean Moldovan authored
-
- 27 Sep, 2016 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
Add in casts for c++11s chrono classes to pythons datetime
-