Skip to content

Commit 0bf7374

Browse files
authored
Merge branch 'main' into improvement/ABCMeta_subclasscheck
2 parents 23df287 + baefaa6 commit 0bf7374

File tree

85 files changed

+1263
-687
lines changed

Some content is hidden

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

85 files changed

+1263
-687
lines changed

.github/CODEOWNERS

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
# It uses the same pattern rule for gitignore file
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

7-
# GitHub
7+
# Azure Pipelines
8+
.azure-pipelines/ @AA-Turner
9+
10+
# GitHub & related scripts
811
.github/** @ezio-melotti @hugovk @AA-Turner
12+
Tools/build/compute-changes.py @AA-Turner
13+
Tools/build/verify_ensurepip_wheels.py @AA-Turner
914

1015
# pre-commit
1116
.pre-commit-config.yaml @hugovk
1217
.ruff.toml @hugovk @AlexWaygood @AA-Turner
1318

14-
# Build system
15-
configure* @erlend-aasland @corona10
16-
Makefile.pre.in @erlend-aasland
17-
Modules/Setup* @erlend-aasland
19+
# Build system (autotools)
20+
configure* @erlend-aasland @corona10 @AA-Turner
21+
Makefile.pre.in @erlend-aasland @AA-Turner
22+
Modules/Setup* @erlend-aasland @AA-Turner
23+
Tools/build/regen-configure.sh @AA-Turner
1824

1925
# argparse
2026
**/*argparse* @savannahostrowski
@@ -67,6 +73,7 @@ Doc/make.bat @AA-Turner @hugovk
6773
Doc/requirements.txt @AA-Turner @hugovk
6874
Doc/_static/** @AA-Turner @hugovk
6975
Doc/tools/** @AA-Turner @hugovk
76+
.readthedocs.yml @AA-Turner
7077

7178
# runtime state/lifecycle
7279
**/*pylifecycle* @ericsnowcurrently @ZeroIntensity
@@ -155,6 +162,10 @@ Doc/c-api/module.rst @ericsnowcurrently
155162
**/*importlib/resources/* @jaraco @warsaw @FFY00
156163
**/*importlib/metadata/* @jaraco @warsaw
157164

165+
# Calendar
166+
Lib/calendar.py @AA-Turner
167+
Lib/test/test_calendar.py @AA-Turner
168+
158169
# Dates and times
159170
**/*datetime* @pganssle @abalkin
160171
**/*str*time* @pganssle @abalkin
@@ -205,6 +216,11 @@ Lib/test/test_ast/ @eclips4 @tomasr8
205216
# multiprocessing
206217
**/*multiprocessing* @gpshead
207218

219+
# pydoc
220+
Lib/pydoc.py @AA-Turner
221+
Lib/pydoc_data/ @AA-Turner
222+
Lib/test/test_pydoc/ @AA-Turner
223+
208224
# SQLite 3
209225
**/*sqlite* @berkerpeksag @erlend-aasland
210226

@@ -217,6 +233,11 @@ Lib/test/test_ast/ @eclips4 @tomasr8
217233
**/*pdb* @gaogaotiantian
218234
**/*bdb* @gaogaotiantian
219235

236+
# types
237+
Lib/test/test_types.py @AA-Turner
238+
Lib/types.py @AA-Turner
239+
Modules/_typesmodule.c @AA-Turner
240+
220241
# Limited C API & stable ABI
221242
Tools/build/stable_abi.py @encukou
222243
Misc/stable_abi.toml @encukou
@@ -234,6 +255,11 @@ Doc/c-api/stable.rst @encukou
234255
/Tools/msi/ @python/windows-team
235256
/Tools/nuget/ @python/windows-team
236257

258+
# Zstandard
259+
Lib/compression/zstd/ @AA-Turner
260+
Lib/test/test_zstd.py @AA-Turner
261+
Modules/_zstd/ @AA-Turner
262+
237263
# Misc
238264
**/*itertools* @rhettinger
239265
**/*collections* @rhettinger
@@ -266,6 +292,9 @@ Doc/c-api/stable.rst @encukou
266292

267293
**/*cjkcodecs* @corona10
268294

295+
# Patchcheck
296+
Tools/patchcheck/ @AA-Turner
297+
269298
# macOS
270299
/Mac/ @python/macos-team
271300
**/*osx_support* @python/macos-team
@@ -277,9 +306,9 @@ Doc/c-api/stable.rst @encukou
277306
**/*zipfile/_path/* @jaraco
278307

279308
# Argument Clinic
280-
/Tools/clinic/** @erlend-aasland
281-
/Lib/test/test_clinic.py @erlend-aasland
282-
Doc/howto/clinic.rst @erlend-aasland
309+
/Tools/clinic/** @erlend-aasland @AA-Turner
310+
/Lib/test/test_clinic.py @erlend-aasland @AA-Turner
311+
Doc/howto/clinic.rst @erlend-aasland @AA-Turner
283312

284313
# Subinterpreters
285314
**/*interpreteridobject.* @ericsnowcurrently
@@ -323,6 +352,7 @@ Lib/test/test_configparser.py @jaraco
323352

324353
# Doc sections
325354
Doc/reference/ @willingc @AA-Turner
355+
Doc/whatsnew/ @AA-Turner
326356

327357
**/*weakref* @kumaraditya303
328358

@@ -336,7 +366,7 @@ Modules/_xxtestfuzz/ @ammaraskar
336366
# t-strings
337367
**/*interpolationobject* @lysnikolaou
338368
**/*templateobject* @lysnikolaou
339-
**/*templatelib* @lysnikolaou
369+
**/*templatelib* @lysnikolaou @AA-Turner
340370
**/*tstring* @lysnikolaou
341371

342372
# Remote debugging
@@ -346,3 +376,6 @@ Modules/_remote_debugging_module.c @pablogsal @ambv @1st1
346376

347377
# gettext
348378
**/*gettext* @tomasr8
379+
380+
# Internal Docs
381+
InternalDocs/ @AA-Turner

.github/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributing to Python
44
Build Status
55
------------
66

7-
- `Buildbot status overview <https://buildbot.python.org/all/#/release_status>`_
7+
- `Buildbot status overview <https://buildbot.python.org/#/release_status>`_
88

99
- `GitHub Actions status <https://github.com/python/cpython/actions/workflows/build.yml>`_
1010

Android/android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def unpack_deps(host, prefix_dir):
187187
os.chdir(prefix_dir)
188188
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
189189
for name_ver in ["bzip2-1.0.8-3", "libffi-3.4.4-3", "openssl-3.0.15-4",
190-
"sqlite-3.49.1-0", "xz-5.4.6-1", "zstd-1.5.7-1"]:
190+
"sqlite-3.50.4-0", "xz-5.4.6-1", "zstd-1.5.7-1"]:
191191
filename = f"{name_ver}-{host}.tar.gz"
192192
download(f"{deps_url}/{name_ver}/{filename}")
193193
shutil.unpack_archive(filename)

Doc/c-api/long.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
372372
Set *\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t`
373373
representation of *obj*.
374374
375+
If *obj* is not an instance of :c:type:`PyLongObject`, first call its
376+
:meth:`~object.__index__` method (if present) to convert it to a
377+
:c:type:`PyLongObject`.
378+
375379
If the *obj* value is out of range, raise an :exc:`OverflowError`.
376380
377381
Set *\*value* and return ``0`` on success.

Doc/conf.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,11 @@
567567
'image': '_static/og-image.png',
568568
'line_color': '#3776ab',
569569
}
570-
if 'builder_html' in tags: # noqa: F821
571-
ogp_custom_meta_tags = [
572-
'<meta name="theme-color" content="#3776ab">',
573-
]
574-
if 'create-social-cards' not in tags: # noqa: F821
575-
# Define a static preview image when not creating social cards
576-
ogp_image = '_static/og-image.png'
577-
ogp_custom_meta_tags += [
578-
'<meta property="og:image:width" content="200">',
579-
'<meta property="og:image:height" content="200">',
580-
]
570+
ogp_custom_meta_tags = ('<meta name="theme-color" content="#3776ab">',)
571+
if 'create-social-cards' not in tags: # noqa: F821
572+
# Define a static preview image when not creating social cards
573+
ogp_image = '_static/og-image.png'
574+
ogp_custom_meta_tags += (
575+
'<meta property="og:image:width" content="200">',
576+
'<meta property="og:image:height" content="200">',
577+
)

Doc/extending/extending.rst

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,37 @@ the module and a copyright notice if you like).
7575
See :ref:`arg-parsing-string-and-buffers` for a description of this macro.
7676

7777
All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or
78-
``PY``, except those defined in standard header files. For convenience, and
79-
since they are used extensively by the Python interpreter, ``"Python.h"``
80-
includes a few standard header files: ``<stdio.h>``, ``<string.h>``,
81-
``<errno.h>``, and ``<stdlib.h>``. If the latter header file does not exist on
82-
your system, it declares the functions :c:func:`malloc`, :c:func:`free` and
83-
:c:func:`realloc` directly.
78+
``PY``, except those defined in standard header files.
79+
80+
.. tip::
81+
82+
For backward compatibility, :file:`Python.h` includes several standard header files.
83+
C extensions should include the standard headers that they use,
84+
and should not rely on these implicit includes.
85+
If using the limited C API version 3.13 or newer, the implicit includes are:
86+
87+
* ``<assert.h>``
88+
* ``<intrin.h>`` (on Windows)
89+
* ``<inttypes.h>``
90+
* ``<limits.h>``
91+
* ``<math.h>``
92+
* ``<stdarg.h>``
93+
* ``<wchar.h>``
94+
* ``<sys/types.h>`` (if present)
95+
96+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.12 or older,
97+
the headers below are also included:
98+
99+
* ``<ctype.h>``
100+
* ``<unistd.h>`` (on POSIX)
101+
102+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.10 or older,
103+
the headers below are also included:
104+
105+
* ``<errno.h>``
106+
* ``<stdio.h>``
107+
* ``<stdlib.h>``
108+
* ``<string.h>``
84109

85110
The next thing we add to our module file is the C function that will be called
86111
when the Python expression ``spam.system(string)`` is evaluated (we'll see

Doc/glossary.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ Glossary
435435
with :term:`abstract base classes <abstract base class>`.) Instead, it
436436
typically employs :func:`hasattr` tests or :term:`EAFP` programming.
437437

438+
dunder
439+
An informal short-hand for "double underscore", used when talking about a
440+
:term:`special method`. For example, ``__init__`` is often pronounced
441+
"dunder init".
442+
438443
EAFP
439444
Easier to ask for forgiveness than permission. This common Python coding
440445
style assumes the existence of valid keys or attributes and catches
@@ -462,6 +467,7 @@ Glossary
462467
core and with user code.
463468

464469
f-string
470+
f-strings
465471
String literals prefixed with ``f`` or ``F`` are commonly called
466472
"f-strings" which is short for
467473
:ref:`formatted string literals <f-strings>`. See also :pep:`498`.
@@ -1323,6 +1329,7 @@ Glossary
13231329
See also :term:`borrowed reference`.
13241330

13251331
t-string
1332+
t-strings
13261333
String literals prefixed with ``t`` or ``T`` are commonly called
13271334
"t-strings" which is short for
13281335
:ref:`template string literals <t-strings>`.
@@ -1472,6 +1479,11 @@ Glossary
14721479
A computer defined entirely in software. Python's virtual machine
14731480
executes the :term:`bytecode` emitted by the bytecode compiler.
14741481

1482+
walrus operator
1483+
A light-hearted way to refer to the :ref:`assignment expression
1484+
<assignment-expressions>` operator ``:=`` because it looks a bit like a
1485+
walrus if you turn your head.
1486+
14751487
Zen of Python
14761488
Listing of Python design principles and philosophies that are helpful in
14771489
understanding and using the language. The listing can be found by typing

Doc/library/ast.rst

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ Literals
289289
* ``conversion`` is an integer:
290290

291291
* -1: no formatting
292-
* 115 (``ord('s')``): ``!s`` string formatting
293-
* 114 (``ord('r')``): ``!r`` repr formatting
294-
* 97 (``ord('a')``): ``!a`` ASCII formatting
292+
* 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` formatting
293+
* 114 (``ord('r')``): ``!r`` :func:`repr` formatting
294+
* 115 (``ord('s')``): ``!s`` :func:`string <str>` formatting
295295

296296
* ``format_spec`` is a :class:`JoinedStr` node representing the formatting
297297
of the value, or ``None`` if no format was specified. Both
@@ -325,14 +325,18 @@ Literals
325325
Constant(value='.3')]))]))
326326

327327

328-
.. class:: TemplateStr(values)
328+
.. class:: TemplateStr(values, /)
329329

330-
A t-string, comprising a series of :class:`Interpolation` and :class:`Constant`
331-
nodes.
330+
.. versionadded:: 3.14
331+
332+
Node representing a template string literal, comprising a series of
333+
:class:`Interpolation` and :class:`Constant` nodes.
334+
These nodes may be any order, and do not need to be interleaved.
332335

333336
.. doctest::
334337

335-
>>> print(ast.dump(ast.parse('t"{name} finished {place:ordinal}"', mode='eval'), indent=4))
338+
>>> expr = ast.parse('t"{name} finished {place:ordinal}"', mode='eval')
339+
>>> print(ast.dump(expr, indent=4))
336340
Expression(
337341
body=TemplateStr(
338342
values=[
@@ -349,28 +353,28 @@ Literals
349353
values=[
350354
Constant(value='ordinal')]))]))
351355

352-
.. versionadded:: 3.14
353-
356+
.. class:: Interpolation(value, str, conversion, format_spec=None)
354357

355-
.. class:: Interpolation(value, str, conversion, format_spec)
358+
.. versionadded:: 3.14
356359

357-
Node representing a single interpolation field in a t-string.
360+
Node representing a single interpolation field in a template string literal.
358361

359362
* ``value`` is any expression node (such as a literal, a variable, or a
360363
function call).
364+
This has the same meaning as ``FormattedValue.value``.
361365
* ``str`` is a constant containing the text of the interpolation expression.
362366
* ``conversion`` is an integer:
363367

364368
* -1: no conversion
365-
* 115: ``!s`` string conversion
366-
* 114: ``!r`` repr conversion
367-
* 97: ``!a`` ascii conversion
369+
* 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` conversion
370+
* 114 (``ord('r')``): ``!r`` :func:`repr` conversion
371+
* 115 (``ord('s')``): ``!s`` :func:`string <str>` conversion
368372

373+
This has the same meaning as ``FormattedValue.conversion``.
369374
* ``format_spec`` is a :class:`JoinedStr` node representing the formatting
370375
of the value, or ``None`` if no format was specified. Both
371376
``conversion`` and ``format_spec`` can be set at the same time.
372-
373-
.. versionadded:: 3.14
377+
This has the same meaning as ``FormattedValue.format_spec``.
374378

375379

376380
.. class:: List(elts, ctx)

Doc/library/codecs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ particular, the following variants typically exist:
12511251
+-----------------+--------------------------------+--------------------------------+
12521252
| iso8859_3 | iso-8859-3, latin3, L3 | Esperanto, Maltese |
12531253
+-----------------+--------------------------------+--------------------------------+
1254-
| iso8859_4 | iso-8859-4, latin4, L4 | Baltic languages |
1254+
| iso8859_4 | iso-8859-4, latin4, L4 | Northern Europe |
12551255
+-----------------+--------------------------------+--------------------------------+
12561256
| iso8859_5 | iso-8859-5, cyrillic | Belarusian, Bulgarian, |
12571257
| | | Macedonian, Russian, Serbian |

0 commit comments

Comments
 (0)