diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-02-16 15:05:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 15:05:58 (GMT) |
commit | cc54001c2eb3b14320c1667b22602d69c90d5865 (patch) | |
tree | 1c4b39bfc9027e42b3f18c0cae147a8d0f7115e4 /Include | |
parent | 17dbd4078b68db8954df6b5cdc40b786bc4ad7af (diff) | |
download | cpython-cc54001c2eb3b14320c1667b22602d69c90d5865.zip cpython-cc54001c2eb3b14320c1667b22602d69c90d5865.tar.gz cpython-cc54001c2eb3b14320c1667b22602d69c90d5865.tar.bz2 |
bpo-40170: Always define PyIter_Check() as a function (GH-24548)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/abstract.h | 2 | ||||
-rw-r--r-- | Include/cpython/abstract.h | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 0bd1ca9..a47c944 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -324,7 +324,7 @@ PyAPI_FUNC(PyObject *) PyObject_Format(PyObject *obj, returns itself. */ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *); -/* Returns 1 if the object 'obj' provides iterator protocols, and 0 otherwise. +/* Returns non-zero if the object 'obj' provides iterator protocols, and 0 otherwise. This function always succeeds. */ PyAPI_FUNC(int) PyIter_Check(PyObject *); diff --git a/Include/cpython/abstract.h b/Include/cpython/abstract.h index 7a4219c..db5055d 100644 --- a/Include/cpython/abstract.h +++ b/Include/cpython/abstract.h @@ -325,12 +325,6 @@ PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf, /* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */ PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view); -/* ==== Iterators ================================================ */ - -#define PyIter_Check(obj) \ - (Py_TYPE(obj)->tp_iternext != NULL && \ - Py_TYPE(obj)->tp_iternext != &_PyObject_NextNotImplemented) - /* === Sequence protocol ================================================ */ /* Assume tp_as_sequence and sq_item exist and that 'i' does not |