8000 Catch up with main · python/cpython@f90bd1e · GitHub
[go: up one dir, main page]

Skip to content

Commit f90bd1e

Browse files
committed
Catch up with main
2 parents 66a5659 + 6c13e13 commit f90bd1e

File tree

315 files changed

+9741
-6202
lines changed

Some content is hidden

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

315 files changed

+9741
-6202
lines changed

.cirrus.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
freebsd_task:
2+
freebsd_instance:
3+
matrix:
4+
- image: freebsd-13-2-release-amd64
5+
# Turn off TCP and UDP blackhole. It is not enabled by default in FreeBSD,
6+
# but it is in the FreeBSD GCE images as used by Cirrus-CI. It causes even
7+
# local local connections to fail with ETIMEDOUT instead of ECONNREFUSED.
8+
# For more information see https://reviews.freebsd.org/D41751 and
9+
# https://github.com/cirruslabs/cirrus-ci-docs/issues/483.
10+
sysctl_script:
11+
- sysctl net.inet.tcp.blackhole=0
12+
- sysctl net.inet.udp.blackhole=0
13+
configure_script:
14+
- mkdir build
15+
- cd build
16+
- ../configure --with-pydebug
17+
build_script:
18+
- cd build
19+
- make -j$(sysctl -n hw.ncpu)
20+
pythoninfo_script:
21+
- cd build
22+
- make pythoninfo
23+
test_script:
24+
- cd build
25+
# dtrace fails to build on FreeBSD - see gh-73263
26+
- make buildbottest TESTOPTS="-j0 -x test_dtrace --timeout=600"

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PC/classicAppCompat.* binary
2424
[attr]noeol -text
2525

2626
Lib/test/cjkencodings/* noeol
27-
Lib/test/coding20731.py noeol
27+
Lib/test/tokenizedata/coding20731.py noeol
2828
Lib/test/decimaltestdata/*.decTest noeol
2929
Lib/test/test_email/data/*.txt noeol
3030
Lib/test/test_importlib/resources/data01/* noeol

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
# pre-commit
1111
.pre-commit-config.yaml @hugovk @AlexWaygood
12+
.ruff.toml @hugovk @AlexWaygood
1213

1314
# Build system
1415
configure* @erlend-aasland @corona10
@@ -179,3 +180,6 @@ Doc/c-api/stable.rst @encukou
179180
/Tools/clinic/** @erlend-aasland @AlexWaygood
180181
/Lib/test/test_clinic.py @erlend-aasland @AlexWaygood
181182
Doc/howto/clinic.rst @erlend-aasland
183+
184+
# WebAssembly
185+
/Tools/wasm/ @brettcannon

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
# into the PR branch anyway.
6464
#
6565
# https://github.com/python/core-workflow/issues/373
66-
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
66+
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
6767
fi
6868
6969
# Check if we should run hypothesis tests

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on: [push, pull_request, workflow_dispatch]
55
permissions:
66
contents: read
77

8+
env:
9+
FORCE_COLOR: 1
10+
RUFF_FORMAT: github
11+
812
concurrency:
913
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1014
cancel-in-progress: true

.github/workflows/require-pr-label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
types: [opened, reopened, labeled, unlabeled, synchronize]
66

77
permissions:
8-
issues: read
9-
pull-requests: read
8+
issues: write
9+
pull-requests: write
1010

1111
jobs:
1212
label:

.pre-commit-config.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.0.288
4+
hooks:
5+
- id: ruff
6+
name: Run Ruff on Lib/test/
7+
args: [--exit-non-zero-on-fix]
8+
files: ^Lib/test/
9+
210
- repo: https://github.com/pre-commit/pre-commit-hooks
311
rev: v4.4.0
412
hooks:
13+
- id: check-toml
14+
exclude: ^Lib/test/test_tomllib/
515
- id: check-yaml
616
- id: end-of-file-fixer
717
types: [python]
8-
exclude: Lib/test/coding20731.py
18+
exclude: Lib/test/tokenizedata/coding20731.py
919
- id: trailing-whitespace
1020
types_or: [c, python, rst]
1121

Doc/library/ast.rst

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,10 @@ Expressions
650650

651651
.. class:: NamedExpr(target, value)
652652

653-
A named expression. This AST node is produced by the assignment expressions
654-
operator (also known as the walrus operator). As opposed to the :class:`Assign`
655-
node in which the first argument can be multiple nodes, in this case both
656-
``target`` and ``value`` must be single nodes.
653+
A named expression. This AST node is produced by the assignment expressions
654+
operator (also known as the walrus operator). As opposed to the :class:`Assign`
655+
node in which the first argument can be multiple nodes, in this case both
656+
``target`` and ``value`` must be single nodes.
657657

658658
.. doctest::
659659

@@ -663,6 +663,7 @@ Expressions
663663
target=Name(id='x', ctx=Store()),
664664
value=Constant(value=4)))
665665

666+
.. versionadded:: 3.8
666667

667668
Subscripting
668669
~~~~~~~~~~~~
@@ -1036,6 +1037,7 @@ Statements
10361037
value=Name(id='int', ctx=Load()))],
10371038
type_ignores=[])
10381039

1040+
.. versionadded:: 3.12
10391041

10401042
Other statements which are only applicable inside functions or loops are
10411043
described in other sections.
@@ -1318,6 +1320,7 @@ Control flow
13181320
finalbody=[])],
13191321
type_ignores=[])
13201322

1323+
.. versionadded:: 3.11
13211324

13221325
.. class:: ExceptHandler(type, name, body)
13231326

@@ -1407,6 +1410,8 @@ Pattern matching
14071410
that is being matched against the cases) and ``cases`` contains an iterable of
14081411
:class:`match_case` nodes with the different cases.
14091412

1413+
.. versionadded:: 3.10
1414+
14101415
.. class:: match_case(pattern, guard, body)
14111416

14121417
A single case pattern in a ``match`` statement. ``pattern`` contains the
@@ -1458,6 +1463,8 @@ Pattern matching
14581463
value=Constant(value=Ellipsis))])])],
14591464
type_ignores=[])
14601465

1466+
.. versionadded:: 3.10
1467+
14611468
.. class:: MatchValue(value)
14621469

14631470
A match literal or value pattern that compares by equality. ``value`` is
@@ -1485,6 +1492,8 @@ Pattern matching
14851492
value=Constant(value=Ellipsis))])])],
14861493
type_ignores=[])
14871494

1495+
.. versionadded:: 3.10
1496+
14881497
.. class:: MatchSingleton(value)
14891498

14901499
A match literal pattern that compares by identity. ``value`` is the
@@ -1510,6 +1519,8 @@ Pattern matching
15101519
value=Constant(value=Ellipsis))])])],
15111520
type_ignores=[])
15121521

1522+
.. versionadded:: 3.10
1523+
15131524
.. class:: MatchSequence(patterns)
15141525

15151526
A match sequence pattern. ``patterns`` contains the patterns to be matched
@@ -1541,6 +1552,8 @@ Pattern matching
15411552
value=Constant(value=Ellipsis))])])],
15421553
type_ignores=[])
15431554

1555+
.. versionadded:: 3.10
1556+
15441557
.. class:: MatchStar(name)
15451558

15461559
Matches the rest of the sequence in a variable length match sequence pattern.
@@ -1581,6 +1594,8 @@ Pattern matching
15811594
value=Constant(value=Ellipsis))])])],
15821595
type_ignores=[])
15831596

1597+
.. versionadded:: 3.10
1598+
15841599
.. class:: MatchMapping(keys, patterns, rest)
15851600

15861601
A match mapping pattern. ``keys`` is a sequence of expression nodes.
@@ -1627,6 +1642,8 @@ Pattern matching
16271642
value=Constant(value=Ellipsis))])])],
16281643
type_ignores=[])
16291644

1645+
.. versionadded:: 3.10
1646+
16301647
.. class:: MatchClass(cls, patterns, kwd_attrs, kwd_patterns)
16311648

16321649
A match class pattern. ``cls`` is an expression giving the nominal class to
@@ -1691,6 +1708,8 @@ Pattern matching
16911708
value=Constant(value=Ellipsis))])])],
16921709
type_ignores=[])
16931710

1711+
.. versionadded:: 3.10
1712+
16941713
.. class:: MatchAs(pattern, name)
16951714

16961715
A match "as-pattern", capture pattern or wildcard pattern. ``pattern``
@@ -1732,6 +1751,8 @@ Pattern matching
17321751
value=Constant(value=Ellipsis))])])],
17331752
type_ignores=[])
17341753

1754+
.. versionadded:: 3.10
1755+
17351756
.. class:: MatchOr(patterns)
17361757

17371758
A match "or-pattern". An or-pattern matches each of its subpatterns in turn
@@ -1764,6 +1785,8 @@ Pattern matching
17641785
value=Constant(value=Ellipsis))])])],
17651786
type_ignores=[])
17661787

1788+
.. versionadded:: 3.10
1789+
17671790
.. _ast-type-params:
17681791

17691792
Type parameters
@@ -1795,6 +1818,8 @@ aliases.
17951818
ctx=Load()))],
17961819
type_ignores=[])
17971820

1821+
.. versionadded:: 3.12
1822+
17981823
.. class:: ParamSpec(name)
17991824

18001825
A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification.
@@ -1818,6 +1843,8 @@ aliases.
18181843
ctx=Load()))],
18191844
type_ignores=[])
18201845

1846+
.. versionadded:: 3.12
1847+
18211848
.. class:: TypeVarTuple(name)
18221849

18231850
A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple.
@@ -1842,6 +1869,8 @@ aliases.
18421869
ctx=Load()))],
18431870
type_ignores=[])
18441871

1872+
.. versionadded:: 3.12
1873+
18451874
Function and class definitions
18461875
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18471876

@@ -1861,6 +1890,9 @@ Function and class definitions
18611890

18621891
``type_comment`` is an optional string with the type annotation as a comment.
18631892

1893+
.. versionchanged:: 3.12
1894+
Added ``type_params``.
1895+
18641896

18651897
.. class:: Lambda(args, body)
18661898

@@ -2059,6 +2091,9 @@ Function and class definitions
20592091
type_params=[])],
20602092
type_ignores=[])
20612093

2094+
.. versionchanged:: 3.12
2095+
Added ``type_params``.
2096+
20622097
Async and await
20632098
^^^^^^^^^^^^^^^
20642099

@@ -2067,6 +2102,9 @@ Async and await
20672102
An ``async def`` function definition. Has the same fields as
20682103
:class:`FunctionDef`.
20692104

2105+
.. versionchanged:: 3.12
2106+
Added ``type_params``.
2107+
20702108

20712109
.. class:: Await(value)
20722110

0 commit comments

Comments
 (0)
0