From 632d692e296bfe980e2b1ba233d168135f3de5f4 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 11 May 2015 10:22:20 -0700 Subject: [PATCH] Issue #24161: Document that PyIter_Check() returns false positives for old-style instances. --- Doc/c-api/iter.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst index 8d1567c7b3..fb2a71cf1a 100644 --- a/Doc/c-api/iter.rst +++ b/Doc/c-api/iter.rst @@ -14,6 +14,10 @@ There are two functions specifically for working with iterators. Return true if the object *o* supports the iterator protocol. + This function can return a false positive in the case of old-style + classes because those classes always define a :c:member:`tp_iternext` + slot with logic that either invokes a :meth:`next` method or raises + a :exc:`TypeError`. .. c:function:: PyObject* PyIter_Next(PyObject *o) -- 2.50.1