Skip to content

Commit 3690688

Browse files
authored
GH-101898: Fix missing term references for hashable definition (#101899)
Fix missing term references for hashable definition
1 parent e5da9ab commit 3690688

16 files changed

+22
-22
lines changed

Doc/c-api/dict.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Dictionary Objects
8080
8181
.. c:function:: int PyDict_DelItem(PyObject *p, PyObject *key)
8282
83-
Remove the entry in dictionary *p* with key *key*. *key* must be hashable;
83+
Remove the entry in dictionary *p* with key *key*. *key* must be :term:`hashable`;
8484
if it isn't, :exc:`TypeError` is raised.
8585
If *key* is not in the dictionary, :exc:`KeyError` is raised.
8686
Return ``0`` on success or ``-1`` on failure.

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Object Protocol
281281
282282
.. c:function:: Py_hash_t PyObject_HashNotImplemented(PyObject *o)
283283
284-
Set a :exc:`TypeError` indicating that ``type(o)`` is not hashable and return ``-1``.
284+
Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` and return ``-1``.
285285
This function receives special treatment when stored in a ``tp_hash`` slot,
286286
allowing a type to explicitly indicate to the interpreter that it is not
287287
hashable.

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ method result will be released right away. The disadvantage is that if
19791979
instances accumulate, so too will the accumulated method results. They
19801980
can grow without bound.
19811981

1982-
The *lru_cache* approach works with methods that have hashable
1982+
The *lru_cache* approach works with methods that have :term:`hashable`
19831983
arguments. It creates a reference to the instance unless special
19841984
efforts are made to pass in weak references.
19851985

Doc/library/abc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The :mod:`collections` module has some concrete classes that derive from
2121
ABCs; these can, of course, be further derived. In addition, the
2222
:mod:`collections.abc` submodule has some ABCs that can be used to test whether
2323
a class or instance provides a particular interface, for example, if it is
24-
hashable or if it is a mapping.
24+
:term:`hashable` or if it is a mapping.
2525

2626

2727
This module provides the metaclass :class:`ABCMeta` for defining ABCs and

Doc/library/collections.abc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
This module provides :term:`abstract base classes <abstract base class>` that
2424
can be used to test whether a class provides a particular interface; for
25-
example, whether it is hashable or whether it is a mapping.
25+
example, whether it is :term:`hashable` or whether it is a mapping.
2626

2727
An :func:`issubclass` or :func:`isinstance` test for an interface works in one
2828
of three ways.
@@ -406,7 +406,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
406406
(3)
407407
The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash value
408408
for the set; however, :meth:`__hash__` is not defined because not all sets
409-
are hashable or immutable. To add set hashability using mixins,
409+
are :term:`hashable` or immutable. To add set hashability using mixins,
410410
inherit from both :meth:`Set` and :meth:`Hashable`, then define
411411
``__hash__ = Set._hash``.
412412

Doc/library/collections.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Python's general purpose built-in containers, :class:`dict`, :class:`list`,
2525
:func:`namedtuple` factory function for creating tuple subclasses with named fields
2626
:class:`deque` list-like container with fast appends and pops on either end
2727
:class:`ChainMap` dict-like class for creating a single view of multiple mappings
28-
:class:`Counter` dict subclass for counting hashable objects
28+
:class:`Counter` dict subclass for counting :term:`hashable` objects
2929
:class:`OrderedDict` dict subclass that remembers the order entries were added
3030
:class:`defaultdict` dict subclass that calls a factory function to supply missing values
3131
:class:`UserDict` wrapper around dictionary objects for easier dict subclassing
@@ -242,7 +242,7 @@ For example::
242242

243243
.. class:: Counter([iterable-or-mapping])
244244

245-
A :class:`Counter` is a :class:`dict` subclass for counting hashable objects.
245+
A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` objects.
246246
It is a collection where elements are stored as dictionary keys
247247
and their counts are stored as dictionary values. Counts are allowed to be
248248
any integer value including zero or negative counts. The :class:`Counter`

Doc/library/datetime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` typ
160160
share these common features:
161161

162162
- Objects of these types are immutable.
163-
- Objects of these types are hashable, meaning that they can be used as
163+
- Objects of these types are :term:`hashable`, meaning that they can be used as
164164
dictionary keys.
165165
- Objects of these types support efficient pickling via the :mod:`pickle` module.
166166

Doc/library/fractions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ another rational number, or from a string.
7777

7878
The :class:`Fraction` class inherits from the abstract base class
7979
:class:`numbers.Rational`, and implements all of the methods and
80-
operations from that class. :class:`Fraction` instances are hashable,
80+
operations from that class. :class:`Fraction` instances are :term:`hashable`,
8181
and should be treated as immutable. In addition,
8282
:class:`Fraction` has the following properties and methods:
8383

Doc/library/functools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The :mod:`functools` module defines the following functions:
147147
threads.
148148

149149
Since a dictionary is used to cache results, the positional and keyword
150-
arguments to the function must be hashable.
150+
arguments to the function must be :term:`hashable`.
151151

152152
Distinct argument patterns may be considered to be distinct calls with
153153
separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)``

Doc/library/graphlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
.. class:: TopologicalSorter(graph=None)
1919

20-
Provides functionality to topologically sort a graph of hashable nodes.
20+
Provides functionality to topologically sort a graph of :term:`hashable` nodes.
2121

2222
A topological order is a linear ordering of the vertices in a graph such that
2323
for every directed edge u -> v from vertex u to vertex v, vertex u comes
@@ -85,7 +85,7 @@
8585
.. method:: add(node, *predecessors)
8686

8787
Add a new node and its predecessors to the graph. Both the *node* and all
88-
elements in *predecessors* must be hashable.
88+
elements in *predecessors* must be :term:`hashable`.
8989

9090
If called multiple times with the same node argument, the set of
9191
dependencies will be the union of all dependencies passed in.

0 commit comments

Comments
 (0)