From: Raymond Hettinger Date: Mon, 11 May 2015 17:22:20 +0000 (-0700) Subject: Issue #24161: Document that PyIter_Check() returns false positives for old-style... X-Git-Tag: v2.7.11rc1~302^2~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=632d692e296bfe980e2b1ba233d168135f3de5f4;p=thirdparty%2FPython%2Fcpython.git Issue #24161: Document that PyIter_Check() returns false positives for old-style instances. --- diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst index 8d1567c7b34a..fb2a71cf1a82 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)