summaryrefslogtreecommitdiffstats
path: root/Doc/library/collections.abc.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2017-09-25 07:52:06 (GMT)
committerGitHub <noreply@github.com>2017-09-25 07:52:06 (GMT)
commit0bf287b6e0a42877b06cbea5d0fe6474d8061caa (patch)
tree76def9a789d144407d61ad7da0190eceef579f95 /Doc/library/collections.abc.rst
parentb1d1c422ccb9a1711c2d90660373edce9204adcb (diff)
downloadcpython-0bf287b6e0a42877b06cbea5d0fe6474d8061caa.zip
cpython-0bf287b6e0a42877b06cbea5d0fe6474d8061caa.tar.gz
cpython-0bf287b6e0a42877b06cbea5d0fe6474d8061caa.tar.bz2
bpo-18558: Clarify glossary entry for "Iterable" (#3732)
Diffstat (limited to 'Doc/library/collections.abc.rst')
-rw-r--r--Doc/library/collections.abc.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst
index 58b03b9..6015453 100644
--- a/Doc/library/collections.abc.rst
+++ b/Doc/library/collections.abc.rst
@@ -107,7 +107,12 @@ ABC Inherits from Abstract Methods Mixin
.. class:: Iterable
ABC for classes that provide the :meth:`__iter__` method.
- See also the definition of :term:`iterable`.
+
+ Checking ``isinstance(obj, Iterable)`` detects classes that are registered
+ as :class:`Iterable` or that have an :meth:`__iter__` method, but it does
+ not detect classes that iterate with the :meth:`__getitem__` method.
+ The only reliable way to determine whether an object is :term:`iterable`
+ is to call ``iter(obj)``.
.. class:: Collection