Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e7b680

Browse files
Pull in main
2 parents 841e8a4 + 81e3aa8 commit 3e7b680

29 files changed

Lines changed: 129 additions & 95 deletions

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/dis.rst

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -768,16 +768,6 @@ iterations of the loop.
768768

769769
.. versionadded:: 3.11
770770

771-
.. opcode:: PREP_RERAISE_STAR
772-
773-
Combines the raised and reraised exceptions list from ``STACK[-1]``, into an
774-
exception group to propagate from a try-except* block. Uses the original exception
775-
group from ``STACK[-2]`` to reconstruct the structure of reraised exceptions. Pops
776-
two items from the stack and pushes the exception to reraise or ``None``
777-
if there isn't one.
778-
779-
.. versionadded:: 3.11
780-
781771
.. opcode:: WITH_EXCEPT_START
782772

783773
Calls the function in position 4 on the stack with arguments (type, val, tb)
@@ -1515,7 +1505,8 @@ iterations of the loop.
15151505
.. opcode:: CALL_INTRINSIC_1
15161506

15171507
Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the
1518-
argument and sets ``STACK[-1]`` to the result. Used to implement functionality that is necessary but not performance critical.
1508+
argument and sets ``STACK[-1]`` to the result. Used to implement
1509+
functionality that is necessary but not performance critical.
15191510

15201511
The operand determines which intrinsic function is called:
15211512

@@ -1529,6 +1520,19 @@ iterations of the loop.
15291520

15301521
.. versionadded:: 3.12
15311522

1523+
.. opcode:: CALL_INTRINSIC_2
1524+
1525+
Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, ``STACK[-1]`` as the
1526+
arguments and sets ``STACK[-1]`` to the result. Used to implement functionality that is
1527+
necessary but not performance critical.
1528+
1529+
The operand determines which intrinsic function is called:
1530+
1531+
* ``0`` Not valid
1532+
* ``1`` Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``.
1533+
1534+
.. versionadded:: 3.12
1535+
15321536

15331537
**Pseudo-instructions**
15341538

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)``

0 commit comments

Comments
 (0)