diff options
author | Brett Cannon <brett@python.org> | 2021-11-20 00:40:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 00:40:34 (GMT) |
commit | be36e0634060c7d5dee8e8876fb888bbb53d992a (patch) | |
tree | dcf28e3105e12b272cdca00de2b260dec6805183 /Doc/glossary.rst | |
parent | 4c616911b69ce07fb35da1721506bfaba0998c30 (diff) | |
download | cpython-be36e0634060c7d5dee8e8876fb888bbb53d992a.zip cpython-be36e0634060c7d5dee8e8876fb888bbb53d992a.tar.gz cpython-be36e0634060c7d5dee8e8876fb888bbb53d992a.tar.bz2 |
bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently required by CPython (GH-29170)
It is now considered a historical accident that e.g. `for` loops and the `iter()` built-in function do not require the iterators they work with to define `__iter__`, only `__next__`.
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r-- | Doc/glossary.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index ccbfc0e..e71f6c0 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -659,6 +659,11 @@ Glossary More information can be found in :ref:`typeiter`. + .. impl-detail:: + + CPython does not consistently apply the requirement that an iterator + define :meth:`__iter__`. + key function A key function or collation function is a callable that returns a value used for sorting or ordering. For example, :func:`locale.strxfrm` is |