Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2144,8 +2144,10 @@ through the container; for mappings, :meth:`__iter__` should be the same as

Called to implement :func:`operator.length_hint`. Should return an estimated
length for the object (which may be greater or less than the actual length).
The length must be an integer ``>=`` 0. This method is purely an
optimization and is never required for correctness.
The length must be an integer ``>=`` 0. The return value may also be
*NotImplemented*, which is treated the same as if the ``__length_hint__``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*NotImplemented*, which is treated the same as if the ``__length_hint__``
:const:`NotImplemented`, which is treated the same as if the ``__length_hint__``

method didn't exist at all. This method is purely an optimization and is
never required for correctness.

.. versionadded:: 3.4

Expand Down