From f5e8b6d9cb345d1cd963e0e375aa3c5ee9c2ac81 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 29 Aug 2016 02:37:03 +0100 Subject: [PATCH] Add handle::is_none() method --- include/pybind11/pytypes.h | 1 + 1 file changed, 1 insertion(+) 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