Skip to content

Commit 4ee0f2a

Browse files
author
Wenzel Jakob
committed
add missing instructor for bool_
1 parent f233166 commit 4ee0f2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/pybind11/pytypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ inline pybind11::str handle::str() const {
264264
class bool_ : public object {
265265
public:
266266
PYBIND11_OBJECT_DEFAULT(bool_, object, PyBool_Check)
267+
bool_(bool value) : object(value ? Py_True : Py_False, true) { }
267268
operator bool() const { return m_ptr && PyLong_AsLong(m_ptr) != 0; }
268269
};
269270

0 commit comments

Comments
 (0)