Skip to content

Commit 12edfdc

Browse files
authored
Merge branch 'main' into bugfix/asyncio_lock_locked_returns_true
2 parents b44cfbc + e0293b0 commit 12edfdc

131 files changed

Lines changed: 4170 additions & 1229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/c-api/exceptions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,12 @@ Querying the error indicator
499499
.. c:function:: void PyErr_SetRaisedException(PyObject *exc)
500500
501501
Set *exc* as the exception currently being raised,
502-
clearing the existing exception if one is set.
502+
clearing the existing exception if one is set. If *exc* is ``NULL``,
503+
just clear the existing exception.
503504
504-
.. warning::
505+
*exc* must be a valid exception or ``NULL``.
505506
506-
This call ":term:`steals <steal>`" a reference to *exc*,
507-
which must be a valid exception.
507+
This call ":term:`steals <steal>`" a reference to *exc*.
508508
509509
.. versionadded:: 3.12
510510

Doc/c-api/type.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ but need extra remarks for use as slots:
699699
700700
.. soft-deprecated:: 3.15
701701
702-
When not targetting older Python versions, pefer :c:macro:`!Py_tp_bases`.
702+
When not targeting older Python versions, prefer :c:macro:`!Py_tp_bases`.
703703
704704
The following slots do not correspond to public fields in the
705705
underlying structures:

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3051,7 +3051,7 @@ Buffer Object Structures
30513051

30523052
* Resource cleanup when the counter reaches zero must be done atomically,
30533053
as the final release may race with concurrent releases from other
3054-
threads and dellocation must only happen once.
3054+
threads and deallocation must only happen once.
30553055

30563056
The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep
30573057
track of buffer-specific resources. This field is guaranteed to remain

Doc/howto/abi3t-migration.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Migrating to Stable ABI for free threading (``abi3t``)
88

99
Starting with the 3.15 release, CPython supports a variant of the Stable ABI
1010
that supports :term:`free-threaded <free threading>` Python:
11-
Stable ABI for Free-Threaded Builds, or ``abi3t`` for short.
11+
the Stable ABI for Free-Threaded Builds, or ``abi3t`` for short.
1212
This document describes how to adapt C API extensions to support free threading.
1313

1414
Why do this
1515
===========
1616

17-
The typical reason to use Stable ABI is to reduce the number of artifacts that
18-
you need to build and distribute for each version of your library.
17+
The typical reason to use the Stable ABI is to reduce the number of artifacts
18+
that you need to build and distribute for each version of your library.
1919

2020
Without the Stable ABI, you must build a separate shared library, and typically
2121
a *wheel* distribution, for each feature version of CPython you wish
@@ -87,16 +87,16 @@ builds; even the 3.15+ ones that this table "attributes" to ``abi3t``.)
8787
Why *not* do this
8888
-----------------
8989

90-
There are two main downsides to Stable ABI.
90+
There are two main downsides to the Stable ABI.
9191

92-
First, you extension may become slower, since Stable ABI prioritizes
92+
First, your extension may become slower, since the Stable ABI prioritizes
9393
compatibility over performance.
9494
The difference is usually not noticeable, and often can be mitigated by
9595
using the same source to build both a Stable ABI build and a few
9696
version-specific ones for "tier 1" CPython versions.
9797

9898
Second, not all of the C API is available.
99-
Extensions need to be ported to build for Stable ABI, which may be difficult
99+
Extensions need to be ported to build for the Stable ABI, which may be difficult
100100
or, in rare cases, impossible.
101101

102102
Specifically, ``abi3t`` requires APIs added in CPython 3.15.
@@ -127,15 +127,15 @@ Prerequisites
127127
This guide assumes that you have an extension written directly in C (or C++),
128128
which you want to port to ``abi3t``.
129129

130-
If your extenstion uses a code generator (like Cython) or language binding
130+
If your extension uses a code generator (like Cython) or language binding
131131
(like PyO3), it's best to wait until that tool has support for ``abi3t``.
132132
If you maintain such a tool, you might be able to adapt the instructions
133133
here for your tool.
134134

135135
Non-free-threaded Stable ABI
136136
----------------------------
137137

138-
Your extension should support the Stable ABI (``abi3t``).
138+
Your extension should support the non-free-threaded Stable ABI (``abi3``).
139139
If not, either port it first, or follow this guide but be prepared to fix
140140
issues it does not mention.
141141

@@ -183,7 +183,7 @@ following just after ``#include <Python.h>``::
183183
#error "abi3t define is not set!"
184184
#endif
185185

186-
This should result in a different error than "``abt3t`` define is not set".
186+
This should result in a different error than "``abi3t`` define is not set".
187187

188188
.. note::
189189

@@ -705,7 +705,7 @@ Testing
705705
Note that when you build an extension compatible with multiple versions of
706706
CPython, you should always *test* it with each version it supports (for
707707
example, 3.15, 3.16, and so on).
708-
Stable ABI only guarantees *ABI* compatibility; there may also be behavior
708+
The Stable ABI only guarantees *ABI* compatibility; there may also be behavior
709709
changes -- both intentional ones (covered by :pep:`387`) and bugs.
710710

711711
Be sure to run tests on both free-threaded and non-free-threaded builds

Doc/howto/logging-cookbook.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ Subclass ``QueueListener``
19551955
class NNGSocketListener(logging.handlers.QueueListener):
19561956
19571957
def __init__(self, uri, /, *handlers, **kwargs):
1958-
# Have a timeout for interruptability, and open a
1958+
# Have a timeout for interruptibility, and open a
19591959
# subscriber socket
19601960
socket = pynng.Sub0(listen=uri, recv_timeout=500)
19611961
# The b'' subscription matches all topics

Doc/library/ast.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ Control flow
13661366

13671367
``try`` blocks which are followed by ``except*`` clauses. The attributes are the
13681368
same as for :class:`Try` but the :class:`ExceptHandler` nodes in ``handlers``
1369-
are interpreted as ``except*`` blocks rather then ``except``.
1369+
are interpreted as ``except*`` blocks rather than ``except``.
13701370

13711371
.. doctest::
13721372

Doc/library/compression.zstd.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ Advanced parameter control
503503
The :meth:`~.bounds` method can be used on any attribute to get the valid
504504
values for that parameter.
505505

506-
Parameters are optional; any omitted parameter will have it's value selected
506+
Parameters are optional; any omitted parameter will have its value selected
507507
automatically.
508508

509509
Example getting the lower and upper bound of :attr:`~.compression_level`::
@@ -732,7 +732,7 @@ Advanced parameter control
732732

733733
An :class:`~enum.IntEnum` containing the advanced decompression parameter
734734
keys that can be used when decompressing data. Parameters are optional; any
735-
omitted parameter will have it's value selected automatically.
735+
omitted parameter will have its value selected automatically.
736736

737737
The :meth:`~.bounds` method can be used on any attribute to get the valid
738738
values for that parameter.

Doc/library/curses.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,8 @@ Reading window contents
13211321
The bottom 8 bits are the character proper and the upper bits are the attributes;
13221322
extract them with the :data:`A_CHARTEXT` and :data:`A_ATTRIBUTES` bit-masks,
13231323
and the color pair with :func:`pair_number`.
1324+
The character byte is the locale-encoded byte of the cell's character,
1325+
consistent with :meth:`instr`.
13241326
It cannot represent a cell holding combining characters, a character that does
13251327
not fit in a single byte, or a color pair outside the :func:`color_pair`
13261328
range; use :meth:`in_wch` for those, which returns it as a :class:`complexchar`.

Doc/library/datatypes.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ The modules described in this chapter provide a variety of specialized data
88
types such as dates and times, fixed-type arrays, heap queues, double-ended
99
queues, and enumerations.
1010

11-
Python also provides some built-in data types, in particular,
12-
:class:`dict`, :class:`list`, :class:`set` and :class:`frozenset`, and
13-
:class:`tuple`. The :class:`str` class is used to hold
11+
Python also provides :ref:`some built-in data types <bltin-types>`, in particular,
12+
:class:`list`, :class:`tuple`, :class:`dict`, :class:`frozendict`,
13+
:class:`set`, and :class:`frozenset`.
14+
The :class:`str` class is used to hold
1415
Unicode strings, and the :class:`bytes` and :class:`bytearray` classes are used
1516
to hold binary data.
1617

Doc/library/functions.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,11 @@ are always available. They are listed here in alphabetical order.
21792179
in the same way that keywords in a class
21802180
definition (besides *metaclass*) would.
21812181

2182+
Unlike a :keyword:`class` statement, the three argument form does not
2183+
call the metaclass ``__prepare__`` method (see :ref:`prepare`). Use
2184+
:func:`types.new_class` to dynamically create a class using the
2185+
appropriate metaclass.
2186+
21822187
See also :ref:`class-customization`.
21832188

21842189
.. versionchanged:: 3.6

0 commit comments

Comments
 (0)