Skip to content

Commit

Permalink
Enable py::ellipsis on Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickJadoul committed Aug 3, 2020
1 parent 1caf1d0 commit 056f7e5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,7 @@ inline bool PyIterable_Check(PyObject *obj) {
}

inline bool PyNone_Check(PyObject *o) { return o == Py_None; }
#if PY_MAJOR_VERSION >= 3
inline bool PyEllipsis_Check(PyObject *o) { return o == Py_Ellipsis; }
#endif

inline bool PyUnicode_Check_Permissive(PyObject *o) { return PyUnicode_Check(o) || PYBIND11_BYTES_CHECK(o); }

Expand Down Expand Up @@ -1020,13 +1018,11 @@ class none : public object {
none() : object(Py_None, borrowed_t{}) { }
};

#if PY_MAJOR_VERSION >= 3
class ellipsis : public object {
public:
PYBIND11_OBJECT(ellipsis, object, detail::PyEllipsis_Check)
ellipsis() : object(Py_Ellipsis, borrowed_t{}) { }
};
#endif

class bool_ : public object {
public:
Expand Down

0 comments on commit 056f7e5

Please sign in to comment.