diff options
Diffstat (limited to 'Doc/reference/datamodel.rst')
-rw-r--r-- | Doc/reference/datamodel.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 35925a065fd..058fa90e161 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1375,7 +1375,7 @@ Basic customization :meth:`__hash__` method of a class is ``None``, instances of the class will raise an appropriate :exc:`TypeError` when a program attempts to retrieve their hash value, and will also be correctly identified as unhashable when - checking ``isinstance(obj, collections.Hashable)``. + checking ``isinstance(obj, collections.abc.Hashable)``. If a class that overrides :meth:`__eq__` needs to retain the implementation of :meth:`__hash__` from a parent class, the interpreter must be told this @@ -1385,7 +1385,7 @@ Basic customization support, it should include ``__hash__ = None`` in the class definition. A class which defines its own :meth:`__hash__` that explicitly raises a :exc:`TypeError` would be incorrectly identified as hashable by - an ``isinstance(obj, collections.Hashable)`` call. + an ``isinstance(obj, collections.abc.Hashable)`` call. .. note:: @@ -1981,7 +1981,7 @@ range of items. It is also recommended that mappings provide the methods :meth:`keys`, :meth:`values`, :meth:`items`, :meth:`get`, :meth:`clear`, :meth:`setdefault`, :meth:`pop`, :meth:`popitem`, :meth:`!copy`, and :meth:`update` behaving similar to those for Python's standard dictionary -objects. The :mod:`collections` module provides a +objects. The :mod:`collections.abc` module provides a :class:`~collections.abc.MutableMapping` abstract base class to help create those methods from a base set of :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__`, and :meth:`keys`. |