diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-09-25 07:57:24 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2017-09-25 07:57:24 (GMT) |
commit | 01438ed4c22ca150da1cc5c38d83a59b0b6a62a7 (patch) | |
tree | a2d2d77008c695e7caa7ab207b271a9ffcdf3376 /Doc/library | |
parent | d38caf68bb417232fb0ccecb5558d7d0ca4a9507 (diff) | |
download | cpython-01438ed4c22ca150da1cc5c38d83a59b0b6a62a7.zip cpython-01438ed4c22ca150da1cc5c38d83a59b0b6a62a7.tar.gz cpython-01438ed4c22ca150da1cc5c38d83a59b0b6a62a7.tar.bz2 |
[3.6] bpo-18558: Clarify glossary entry for "Iterable" (GH-3732) (#3741)
(cherry picked from commit 0bf287b6e0a42877b06cbea5d0fe6474d8061caa)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/collections.abc.rst | 7 |
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 |