diff options
author | Raymond Hettinger <python@rcn.com> | 2015-05-11 17:22:20 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-05-11 17:22:20 (GMT) |
commit | 632d692e296bfe980e2b1ba233d168135f3de5f4 (patch) | |
tree | 7647d49211bd1196514a1c737b59ca630db1aa6d /Doc/c-api | |
parent | 6c42d1c51f5b96a6db4f786f24f7390fbdba7428 (diff) | |
download | cpython-632d692e296bfe980e2b1ba233d168135f3de5f4.zip cpython-632d692e296bfe980e2b1ba233d168135f3de5f4.tar.gz cpython-632d692e296bfe980e2b1ba233d168135f3de5f4.tar.bz2 |
Issue #24161: Document that PyIter_Check() returns false positives for old-style instances.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/iter.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst index 8d1567c..fb2a71c 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) |