Skip to content

Commit 73ed81d

Browse files
committed
Merge branch 'main' into pythongh-102613-remove-selector-classes
2 parents 6da6a83 + 70f315c commit 73ed81d

50 files changed

Lines changed: 2005 additions & 1103 deletions

Some content is hidden

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

‎.github/workflows/build.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,20 @@ jobs:
8787
with:
8888
filter: |
8989
Doc/**
90-
Misc/**
90+
# Temporarily skip paths with spaces
91+
# (i.e. "C API", "Core and Builtins")
92+
# to avoid "Error: One of your files includes a space".
93+
# Pending https://github.com/python/core-workflow/issues/186
94+
# Misc/**
95+
Misc/NEWS.d/next/Build/**
96+
Misc/NEWS.d/next/Documentation/**
97+
Misc/NEWS.d/next/IDLE/**
98+
Misc/NEWS.d/next/Library/**
99+
Misc/NEWS.d/next/Security/**
100+
Misc/NEWS.d/next/Tests/**
101+
Misc/NEWS.d/next/Tools-Demos/**
102+
Misc/NEWS.d/next/Windows/**
103+
Misc/NEWS.d/next/macOS/**
91104
.github/workflows/reusable-docs.yml
92105
- name: Check for docs changes
93106
if: >-

‎Doc/c-api/exceptions.rst‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,18 @@ Exception Objects
772772
773773
Set :attr:`~BaseException.args` of exception *ex* to *args*.
774774
775+
.. c:function:: PyObject* PyUnstable_Exc_PrepReraiseStar(PyObject *orig, PyObject *excs)
776+
777+
Implement part of the interpreter's implementation of :keyword:`!except*`.
778+
*orig* is the original exception that was caught, and *excs* is the list of
779+
the exceptions that need to be raised. This list contains the the unhandled
780+
part of *orig*, if any, as well as the exceptions that were raised from the
781+
:keyword:`!except*` clauses (so they have a different traceback from *orig*) and
782+
those that were reraised (and have the same traceback as *orig*).
783+
Return the :exc:`ExceptionGroup` that needs to be reraised in the end, or
784+
``None`` if there is nothing to reraise.
785+
786+
.. versionadded:: 3.12
775787
776788
.. _unicodeexceptions:
777789

‎Doc/library/ast.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,17 +1744,17 @@ aliases.
17441744
Function and class definitions
17451745
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17461746

1747-
.. class:: FunctionDef(name, type_params, args, body, decorator_list, returns, type_comment)
1747+
.. class:: FunctionDef(name, args, body, decorator_list, returns, type_comment, type_params)
17481748

17491749
A function definition.
17501750

17511751
* ``name`` is a raw string of the function name.
1752-
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.
17531752
* ``args`` is an :class:`arguments` node.
17541753
* ``body`` is the list of nodes inside the function.
17551754
* ``decorator_list`` is the list of decorators to be applied, stored outermost
17561755
first (i.e. the first in the list will be applied last).
17571756
* ``returns`` is the return annotation.
1757+
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.
17581758

17591759
.. attribute:: type_comment
17601760

@@ -1917,19 +1917,19 @@ Function and class definitions
19171917
type_ignores=[])
19181918

19191919

1920-
.. class:: ClassDef(name, type_params, bases, keywords, body, decorator_list)
1920+
.. class:: ClassDef(name, bases, keywords, body, decorator_list, type_params)
19211921

19221922
A class definition.
19231923

19241924
* ``name`` is a raw string for the class name
1925-
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.
19261925
* ``bases`` is a list of nodes for explicitly specified base classes.
19271926
* ``keywords`` is a list of :class:`keyword` nodes, principally for 'metaclass'.
19281927
Other keywords will be passed to the metaclass, as per `PEP-3115
19291928
<https://peps.python.org/pep-3115/>`_.
19301929
* ``body`` is a list of nodes representing the code within the class
19311930
definition.
19321931
* ``decorator_list`` is a list of nodes, as in :class:`FunctionDef`.
1932+
* ``type_params`` is a list of :ref:`type parameters <ast-type-params>`.
19331933

19341934
.. doctest::
19351935

@@ -1961,7 +1961,7 @@ Function and class definitions
19611961
Async and await
19621962
^^^^^^^^^^^^^^^
19631963

1964-
.. class:: AsyncFunctionDef(name, args, body, decorator_list, returns, type_comment)
1964+
.. class:: AsyncFunctionDef(name, args, body, decorator_list, returns, type_comment, type_params)
19651965

19661966
An ``async def`` function definition. Has the same fields as
19671967
:class:`FunctionDef`.

‎Doc/library/pathlib.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,13 @@ Pure paths provide the following methods and properties:
569569
>>> PurePath('a/b.py').match('/*.py')
570570
False
571571

572+
The *pattern* may be another path object; this speeds up matching the same
573+
pattern against multiple files::
574+
575+
>>> pattern = PurePath('*.py')
576+
>>> PurePath('a/b.py').match(pattern)
577+
True
578+
572579
As with other methods, case-sensitivity follows platform defaults::
573580

574581
>>> PurePosixPath('b.py').match('*.PY')
@@ -581,6 +588,10 @@ Pure paths provide the following methods and properties:
581588
.. versionadded:: 3.12
582589
The *case_sensitive* argument.
583590

591+
.. versionchanged:: 3.13
592+
Support for the recursive wildcard "``**``" was added. In previous
593+
versions, it acted like the non-recursive wildcard "``*``".
594+
584595

585596
.. method:: PurePath.relative_to(other, walk_up=False)
586597

‎Doc/library/traceback.rst‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ The module also defines the following classes:
218218
:class:`TracebackException` objects are created from actual exceptions to
219219
capture data for later printing in a lightweight fashion.
220220

221-
.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False)
221+
.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10)
222222

223223
Capture an exception for later rendering. *limit*, *lookup_lines* and
224224
*capture_locals* are as for the :class:`StackSummary` class.
@@ -230,6 +230,12 @@ capture data for later printing in a lightweight fashion.
230230

231231
Note that when locals are captured, they are also shown in the traceback.
232232

233+
*max_group_width* and *max_group_depth* control the formatting of exception
234+
groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting
235+
level of the group, and the width refers to the size of a single exception
236+
group's exceptions array. The formatted output is truncated when either
237+
limit is exceeded.
238+
233239
.. attribute:: __cause__
234240

235241
A :class:`TracebackException` of the original ``__cause__``.
@@ -238,6 +244,14 @@ capture data for later printing in a lightweight fashion.
238244

239245
A :class:`TracebackException` of the original ``__context__``.
240246

247+
.. attribute:: exceptions
248+
249+
If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of
250+
:class:`TracebackException` instances representing the nested exceptions.
251+
Otherwise it is ``None``.
252+
253+
.. versionadded:: 3.11
254+
241255
.. attribute:: __suppress_context__
242256

243257
The ``__suppress_context__`` value from the original exception.
@@ -323,6 +337,9 @@ capture data for later printing in a lightweight fashion.
323337
.. versionchanged:: 3.10
324338
Added the *compact* parameter.
325339

340+
.. versionchanged:: 3.11
341+
Added the *max_group_width* and *max_group_depth* parameters.
342+
326343

327344
:class:`StackSummary` Objects
328345
-----------------------------

‎Doc/whatsnew/3.13.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ Improved Modules
9090
pathlib
9191
-------
9292

93+
* Add support for recursive wildcards in :meth:`pathlib.PurePath.match`.
94+
(Contributed by Barney Gale in :gh:`73435`.)
95+
9396
* Add *follow_symlinks* keyword-only argument to :meth:`pathlib.Path.glob` and
9497
:meth:`~pathlib.Path.rglob`.
9598
(Contributed by Barney Gale in :gh:`77609`.)

‎Include/cpython/pyerrors.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ PyAPI_FUNC(int) _PyException_AddNote(
116116
PyObject *exc,
117117
PyObject *note);
118118

119+
PyAPI_FUNC(PyObject*) PyUnstable_Exc_PrepReraiseStar(
120+
PyObject *orig,
121+
PyObject *excs);
122+
119123
/* In signalmodule.c */
120124

121125
int PySignal_SetWakeupFd(int fd);

‎Include/internal/pycore_global_objects_fini_generated.h‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Include/internal/pycore_global_strings.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ struct _Py_global_strings {
407407
STRUCT_FOR_ID(exc_value)
408408
STRUCT_FOR_ID(excepthook)
409409
STRUCT_FOR_ID(exception)
410+
STRUCT_FOR_ID(existing_file_name)
410411
STRUCT_FOR_ID(exp)
411412
STRUCT_FOR_ID(extend)
412413
STRUCT_FOR_ID(extra_tokens)
@@ -559,6 +560,7 @@ struct _Py_global_strings {
559560
STRUCT_FOR_ID(namespaces)
560561
STRUCT_FOR_ID(narg)
561562
STRUCT_FOR_ID(ndigits)
563+
STRUCT_FOR_ID(new_file_name)
562564
STRUCT_FOR_ID(new_limit)
563565
STRUCT_FOR_ID(newline)
564566
STRUCT_FOR_ID(newlines)
@@ -613,6 +615,7 @@ struct _Py_global_strings {
613615
STRUCT_FOR_ID(priority)
614616
STRUCT_FOR_ID(progress)
615617
STRUCT_FOR_ID(progress_handler)
618+
STRUCT_FOR_ID(progress_routine)
616619
STRUCT_FOR_ID(proto)
617620
STRUCT_FOR_ID(protocol)
618621
STRUCT_FOR_ID(ps1)

‎Include/internal/pycore_runtime_init_generated.h‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)