diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 51f162918..ba5d2c4c6 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -40,6 +40,7 @@ public: inline detail::accessor attr(const char *key) const; inline pybind11::str str() const; inline pybind11::str repr() const; + bool is_none() const { return m_ptr == Py_None; } template T cast() const; template #if __cplusplus > 201103L