Lines Matching defs:bool

26 inline bool isinstance_generic(handle obj, const std::type_info &tp);
95 template <typename T> bool contains(T &&item) const;
114 bool is(object_api const& other) const { return derived().ptr() == other.derived().ptr(); }
116 bool is_none() const { return derived().ptr() == Py_None; }
118 bool equal(object_api const &other) const { return rich_compare(other, Py_EQ); }
119 bool not_equal(object_api const &other) const { return rich_compare(other, Py_NE); }
120 bool operator<(object_api const &other) const { return rich_compare(other, Py_LT); }
121 bool operator<=(object_api const &other) const { return rich_compare(other, Py_LE); }
122 bool operator>(object_api const &other) const { return rich_compare(other, Py_GT); }
123 bool operator>=(object_api const &other) const { return rich_compare(other, Py_GE); }
158 bool rich_compare(object_api const &other, int value) const;
205 explicit operator bool() const { return m_ptr != nullptr; }
211 bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
213 bool operator!=(const handle &h) const { return m_ptr != h.m_ptr; }
214 PYBIND11_DEPRECATED("Use handle::operator bool() instead")
215 bool check() const { return m_ptr != nullptr; }
234 object(handle h, bool is_borrowed) : handle(h) { if (is_borrowed) inc_ref(); }
347 bool matches(handle exc) const { return PyErr_GivenExceptionMatches(m_type.ptr(), exc.ptr()); }
368 bool isinstance(handle obj) { return T::check_(obj); }
371 bool isinstance(handle obj) { return detail::isinstance_generic(obj, typeid(T)); }
373 template <> inline bool isinstance<handle>(handle obj) = delete;
374 template <> inline bool isinstance<object>(handle obj) { return obj.ptr() != nullptr; }
378 inline bool isinstance(handle obj, handle type) {
387 inline bool hasattr(handle obj, handle name) {
391 inline bool hasattr(handle obj, const char *name) {
496 PYBIND11_DEPRECATED("Use of obj.attr(...) as bool is deprecated in favor of pybind11::hasattr(obj, ...)")
498 std::is_same<T, accessor_policies::obj_attr>::value, bool>() const {
502 PYBIND11_DEPRECATED("Use of obj[key] as bool is deprecated in favor of obj.contains(key)")
503 explicit operator enable_if_t<std::is_same<T, accessor_policies::generic_item>::value, bool>() const {
633 friend bool operator==(const It &a, const It &b) { return a.equal(b); }
634 friend bool operator!=(const It &a, const It &b) { return !(a == b); }
635 friend bool operator< (const It &a, const It &b) { return b - a > 0; }
636 friend bool operator> (const It &a, const It &b) { return b < a; }
637 friend bool operator>=(const It &a, const It &b) { return !(a < b); }
638 friend bool operator<=(const It &a, const It &b) { return !(a > b); }
665 bool equal(const sequence_fast_readonly &b) const { return ptr == b.ptr; }
686 bool equal(const sequence_slow_readwrite &b) const { return index == b.index; }
707 bool equal(const dict_readonly &b) const { return pos == b.pos; }
727 inline bool PyIterable_Check(PyObject *obj) {
738 inline bool PyNone_Check(PyObject *o) { return o == Py_None; }
740 inline bool PyEllipsis_Check(PyObject *o) { return o == Py_Ellipsis; }
743 inline bool PyUnicode_Check_Permissive(PyObject *o) { return PyUnicode_Check(o) || PYBIND11_BYTES_CHECK(o); }
745 inline bool PyStaticMethod_Check(PyObject *o) { return o->ob_type == &PyStaticMethod_Type; }
782 Name(handle h, bool is_borrowed) : Parent(is_borrowed ? Parent(h, borrowed_t{}) : Parent(h, stolen_t{})) { } \
786 bool check() const { return m_ptr != nullptr && (bool) CheckFun(m_ptr); } \
787 static bool check_(handle h) { return h.ptr() != nullptr && CheckFun(h.ptr()); }
868 friend bool operator==(const iterator &a, const iterator &b) { return a->ptr() == b->ptr(); }
869 friend bool operator!=(const iterator &a, const iterator &b) { return a->ptr() != b->ptr(); }
1030 // Allow implicit conversion from and to `bool`:
1031 bool_(bool value) : object(value ? Py_True : Py_False, borrowed_t{}) { }
1032 operator bool() const { return m_ptr && PyLong_AsLong(m_ptr) != 0; }
1129 bool compute(size_t length, size_t *start, size_t *stop, size_t *step,
1136 bool compute(ssize_t length, ssize_t *start, ssize_t *stop, ssize_t *step,
1149 capsule(PyObject *ptr, bool is_borrowed) : object(is_borrowed ? object(ptr, borrowed_t{}) : object(ptr, stolen_t{})) { }
1205 bool empty() const { return size() == 0; }
1225 bool empty() const { return size() == 0; }
1229 template <typename T> bool contains(T &&key) const {
1246 bool empty() const { return size() == 0; }
1260 bool empty() const { return size() == 0; }
1284 bool empty() const { return size() == 0; }
1285 template <typename T> bool add(T &&val) const {
1289 template <typename T> bool contains(T &&val) const {
1303 bool is_cpp_function() const { return (bool) cpp_function(); }
1315 buffer_info request(bool writable = false) const {
1420 template <typename D> template <typename T> bool object_api<D>::contains(T &&item) const {
1421 return attr("__contains__")(std::forward<T>(item)).template cast<bool>();
1434 bool object_api<D>::rich_compare(object_api const &other, int value) const {