Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2d85b8f

Browse files
Merge branch '3.13' into backport-7076d07-3.13
2 parentsc3ce756 +044fe0b commit2d85b8f

File tree

332 files changed

+5365
-1909
lines changed

Some content is hidden

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

332 files changed

+5365
-1909
lines changed

‎.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ Doc/c-api/stable.rst @encukou
194194
**/*itertools*@rhettinger
195195
**/*collections*@rhettinger
196196
**/*random*@rhettinger
197-
**/*queue*@rhettinger
198197
**/*bisect*@rhettinger
199198
**/*heapq*@rhettinger
200199
**/*functools*@rhettinger

‎.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ permissions:
1515
contents:read
1616

1717
concurrency:
18-
group:${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
18+
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
19+
# 'group' must be a key uniquely representing a PR or push event.
20+
# github.workflow is the workflow name
21+
# github.actor is the user invoking the workflow
22+
# github.head_ref is the source branch of the PR or otherwise blank
23+
# github.run_id is a unique number for the current run
24+
group:${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
1925
cancel-in-progress:true
2026

2127
env:
@@ -457,8 +463,9 @@ jobs:
457463
# failing when executed from inside a virtual environment.
458464
"${VENV_PYTHON}" -m test \
459465
-W \
460-
-o \
466+
--slowest \
461467
-j4 \
468+
--timeout 900 \
462469
-x test_asyncio \
463470
-x test_multiprocessing_fork \
464471
-x test_multiprocessing_forkserver \

‎.github/workflows/mypy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ on:
88
pull_request:
99
paths:
1010
-".github/workflows/mypy.yml"
11+
-"Lib/_colorize.py"
1112
-"Lib/_pyrepl/**"
1213
-"Lib/test/libregrtest/**"
14+
-"Lib/tomllib/**"
15+
-"Misc/mypy/**"
16+
-"Tools/build/compute-changes.py"
17+
-"Tools/build/deepfreeze.py"
1318
-"Tools/build/generate_sbom.py"
19+
-"Tools/build/verify_ensurepip_wheels.py"
20+
-"Tools/build/update_file.py"
21+
-"Tools/build/umarshal.py"
1422
-"Tools/cases_generator/**"
1523
-"Tools/clinic/**"
1624
-"Tools/jit/**"
@@ -42,6 +50,7 @@ jobs:
4250
target:[
4351
"Lib/_pyrepl",
4452
"Lib/test/libregrtest",
53+
"Lib/tomllib",
4554
"Tools/build",
4655
"Tools/cases_generator",
4756
"Tools/clinic",

‎.github/workflows/reusable-context.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ jobs:
9797
run:python Tools/build/compute-changes.py
9898
env:
9999
GITHUB_DEFAULT_BRANCH:${{ github.event.repository.default_branch }}
100+
GITHUB_EVENT_NAME:${{ github.event_name }}
101+
CCF_TARGET_REF:${{ github.base_ref || github.event.repository.default_branch }}
102+
CCF_HEAD_REF:${{ github.event.pull_request.head.sha || github.sha }}
100103

101104
-name:Compute hash for config cache key
102105
id:config-hash

‎.github/workflows/reusable-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run:|
6767
set -Eeuo pipefail
6868
# Build docs with the nit-picky option; write warnings to file
69-
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --keep-going --warning-file sphinx-warnings.txt" html
69+
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --warning-file sphinx-warnings.txt" html
7070
-name:'Check warnings'
7171
if:github.event_name == 'pull_request'
7272
run:|
@@ -101,4 +101,4 @@ jobs:
101101
run:make -C Doc/ PYTHON=../python venv
102102
# Use "xvfb-run" since some doctest tests open GUI windows
103103
-name:'Run documentation doctest'
104-
run:xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning --keep-going" doctest
104+
run:xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning" doctest

‎.github/zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ rules:
44
dangerous-triggers:
55
ignore:
66
-documentation-links.yml
7+
unpinned-uses:
8+
config:
9+
policies:
10+
"*":ref-pin

‎.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ Tools/unicode/data/
138138
# hendrikmuhs/ccache-action@v1
139139
/.ccache
140140
/cross-build/
141-
/jit_stencils.h
141+
/jit_stencils*.h
142142
/platform
143143
/profile-clean-stamp
144144
/profile-run-stamp
145145
/profile-bolt-stamp
146+
/profile-gen-stamp
146147
/pybuilddir.txt
147148
/pyconfig.h
148149
/python-config

‎.pre-commit-config.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
-repo:https://github.com/astral-sh/ruff-pre-commit
3-
rev:v0.9.1
3+
rev:v0.11.6
44
hooks:
55
-id:ruff
66
name:Run Ruff (lint) on Doc/
@@ -20,7 +20,7 @@ repos:
2020
files:^Doc/
2121

2222
-repo:https://github.com/psf/black-pre-commit-mirror
23-
rev:24.10.0
23+
rev:25.1.0
2424
hooks:
2525
-id:black
2626
name:Run Black on Tools/jit/
@@ -39,9 +39,11 @@ repos:
3939
exclude:Lib/test/tokenizedata/coding20731.py
4040
-id:trailing-whitespace
4141
types_or:[c, inc, python, rst]
42+
-id:trailing-whitespace
43+
files:'\.(gram)$'
4244

4345
-repo:https://github.com/woodruffw/zizmor-pre-commit
44-
rev:v1.1.1
46+
rev:v1.6.0
4547
hooks:
4648
-id:zizmor
4749

‎Android/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ it:
2525
`android-sdk/cmdline-tools/latest`.
2626
*`export ANDROID_HOME=/path/to/android-sdk`
2727

28-
The`android.py` script also requires the following commands to be on the`PATH`:
28+
The`android.py` script will automatically use the SDK's`sdkmanager` to install
29+
any packages it needs.
30+
31+
The script also requires the following commands to be on the`PATH`:
2932

3033
*`curl`
3134
*`java` (or set the`JAVA_HOME` environment variable)
32-
*`tar`
3335

3436

3537
##Building
@@ -97,7 +99,7 @@ similar to the `Android` directory of the CPython source tree.
9799
The Python test suite can be run on Linux, macOS, or Windows:
98100

99101
* On Linux, the emulator needs access to the KVM virtualization interface, and
100-
a DISPLAY environment variable pointing at an X server.
102+
a DISPLAY environment variable pointing at an X server. Xvfb is acceptable.
101103

102104
The test suite can usually be run on a device with 2 GB of RAM, but this is
103105
borderline, so you may need to increase it to 4 GB. As of Android

‎Android/android.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,19 @@ def make_build_python(context):
138138
run(["make","-j",str(os.cpu_count())])
139139

140140

141-
defunpack_deps(host):
141+
defunpack_deps(host,prefix_dir):
142142
deps_url="https://github.com/beeware/cpython-android-source-deps/releases/download"
143143
forname_verin ["bzip2-1.0.8-2","libffi-3.4.4-3","openssl-3.0.15-4",
144144
"sqlite-3.49.1-0","xz-5.4.6-1"]:
145145
filename=f"{name_ver}-{host}.tar.gz"
146146
download(f"{deps_url}/{name_ver}/{filename}")
147-
run(["tar","-xf",filename])
147+
shutil.unpack_archive(filename,prefix_dir)
148148
os.remove(filename)
149149

150150

151151
defdownload(url,target_dir="."):
152152
out_path=f"{target_dir}/{basename(url)}"
153-
run(["curl","-Lf","-o",out_path,url])
153+
run(["curl","-Lf","--retry","5","--retry-all-errors","-o",out_path,url])
154154
returnout_path
155155

156156

@@ -162,8 +162,7 @@ def configure_host_python(context):
162162
prefix_dir=host_dir/"prefix"
163163
ifnotprefix_dir.exists():
164164
prefix_dir.mkdir()
165-
os.chdir(prefix_dir)
166-
unpack_deps(context.host)
165+
unpack_deps(context.host,prefix_dir)
167166

168167
os.chdir(host_dir)
169168
command= [
@@ -241,16 +240,15 @@ def setup_sdk():
241240
# the Gradle wrapper is not included in the CPython repository. Instead, we
242241
# extract it from the Gradle GitHub repository.
243242
defsetup_testbed():
244-
# The Gradle version used for the build is specified in
245-
# testbed/gradle/wrapper/gradle-wrapper.properties. This wrapper version
246-
# doesn't need to match, as any version of the wrapper can download any
247-
# version of Gradle.
248-
version="8.9.0"
249243
paths= ["gradlew","gradlew.bat","gradle/wrapper/gradle-wrapper.jar"]
250-
251244
ifall((TESTBED_DIR/path).exists()forpathinpaths):
252245
return
253246

247+
# The wrapper version isn't important, as any version of the wrapper can
248+
# download any version of Gradle. The Gradle version actually used for the
249+
# build is specified in testbed/gradle/wrapper/gradle-wrapper.properties.
250+
version="8.9.0"
251+
254252
forpathinpaths:
255253
out_path=TESTBED_DIR/path
256254
out_path.parent.mkdir(exist_ok=True)

‎Doc/c-api/arg.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ Building values
639639
``L`` (:class:`int`) [long long]
640640
Convert a C :c:expr:`long long` to a Python integer object.
641641
642+
.. _capi-py-buildvalue-format-K:
643+
642644
``K`` (:class:`int`) [unsigned long long]
643645
Convert a C :c:expr:`unsigned long long` to a Python integer object.
644646

‎Doc/c-api/buffer.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ characteristic of being backed by a possibly large memory buffer. It is
2626
then desirable, in some situations, to access that buffer directly and
2727
without intermediate copying.
2828

29-
Python provides such a facility at the C level in the form of the:ref:`buffer
30-
protocol <bufferobjects>`. This protocol has two sides:
29+
Python provides such a facility at the Cand Pythonlevel in the form of the
30+
:ref:`bufferprotocol<bufferobjects>`. This protocol has two sides:
3131

3232
..index::single: PyBufferProcs (C type)
3333

3434
- on the producer side, a type can export a "buffer interface" which allows
3535
objects of that type to expose information about their underlying buffer.
36-
This interface is described in the section:ref:`buffer-structs`;
36+
This interface is described in the section:ref:`buffer-structs`; for
37+
Python see:ref:`python-buffer-protocol`.
3738

3839
- on the consumer side, several means are available to obtain a pointer to
39-
the raw underlying data of an object (for example a method parameter).
40+
the raw underlying data of an object (for example a method parameter). For
41+
Python see:class:`memoryview`.
4042

4143
Simple objects such as:class:`bytes` and:class:`bytearray` expose their
4244
underlying buffer in byte-oriented form. Other forms are possible; for example,
@@ -62,6 +64,10 @@ In both cases, :c:func:`PyBuffer_Release` must be called when the buffer
6264
isn't needed anymore. Failure to do so could lead to various issues such as
6365
resource leaks.
6466

67+
..versionadded::3.12
68+
69+
The buffer protocol is now accessible in Python, see
70+
:ref:`python-buffer-protocol` and:class:`memoryview`.
6571

6672
.. _buffer-structure:
6773

‎Doc/c-api/gcsupport.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ provided. In order to use this macro, the :c:member:`~PyTypeObject.tp_traverse`
180180
must name its arguments exactly *visit* and *arg*:
181181
182182
183-
..c:function::voidPy_VISIT(PyObject *o)
183+
..c:macro:: Py_VISIT(o)
184184
185-
If *o* is not ``NULL``, call the *visit* callback, with arguments *o*
185+
Ifthe:c:expr:`PyObject *`*o* is not ``NULL``, call the *visit* callback, with arguments *o*
186186
and *arg*. If *visit* returns a non-zero value, then return it.
187187
Using this macro,:c:member:`~PyTypeObject.tp_traverse` handlers
188188
look like::

‎Doc/c-api/init.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
203203

204204
Set by the:option:`-i` option.
205205

206-
..deprecated::3.12
206+
..deprecated-removed::3.12 3.15
207207

208208
..c:var::int Py_IsolatedFlag
209209
@@ -1190,9 +1190,10 @@ code, or when embedding the Python interpreter:
11901190
.. c:function:: PyThreadState* PyThreadState_Swap(PyThreadState *tstate)
11911191
11921192
Swap the current thread state with the thread state given by the argument
1193-
*tstate*, which may be ``NULL``. The global interpreter lock must be held
1194-
and is not released.
1193+
*tstate*, which may be ``NULL``.
11951194
1195+
The :term:`GIL` does not need to be held, but will be held upon returning
1196+
if *tstate* is non-``NULL``.
11961197
11971198
The following functions use thread-local storage, and are not compatible
11981199
with sub-interpreters:

‎Doc/c-api/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ complete listing.
138138
..c:macro:: Py_ALWAYS_INLINE
139139
140140
Ask the compiler to always inline a static inline function. The compiler can
141-
ignore it anddecides to not inline the function.
141+
ignore it anddecide to not inline the function.
142142

143143
It can be used to inline performance critical static inline functions when
144144
building Python in debug mode with function inlining disabled. For example,

‎Doc/c-api/typeobj.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Quick Reference
7979
|:c:member:`~PyTypeObject.tp_setattro`|:c:type:`setattrofunc`| __setattr__,| X| X|| G|
8080
||| __delattr__|||||
8181
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
82-
|:c:member:`~PyTypeObject.tp_as_buffer`|:c:type:`PyBufferProcs` *||||| %|
82+
|:c:member:`~PyTypeObject.tp_as_buffer`|:c:type:`PyBufferProcs` *|:ref:`sub-slots`|||| %|
8383
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
8484
|:c:member:`~PyTypeObject.tp_flags`| unsigned long|| X| X|| ?|
8585
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
@@ -325,9 +325,10 @@ sub-slots
325325
+---------------------------------------------------------+-----------------------------------+---------------+
326326
||
327327
+---------------------------------------------------------+-----------------------------------+---------------+
328-
|:c:member:`~PyBufferProcs.bf_getbuffer`|:c:func:`getbufferproc`||
328+
|:c:member:`~PyBufferProcs.bf_getbuffer`|:c:func:`getbufferproc`|__buffer__|
329329
+---------------------------------------------------------+-----------------------------------+---------------+
330-
|:c:member:`~PyBufferProcs.bf_releasebuffer`|:c:func:`releasebufferproc`||
330+
|:c:member:`~PyBufferProcs.bf_releasebuffer`|:c:func:`releasebufferproc`| __release_\|
331+
||| buffer\__|
331332
+---------------------------------------------------------+-----------------------------------+---------------+
332333

333334
.. _slot-typedefs-table:

‎Doc/c-api/unicode.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,14 @@ Python:
6868

6969
..c:var:: PyTypeObject PyUnicode_Type
7070
71-
This instance of:c:type:`PyTypeObject` represents the Python Unicode type. It
72-
is exposed to Python code as ``str``.
71+
This instance of:c:type:`PyTypeObject` represents the Python Unicode type.
72+
It is exposed to Python code as ``str``.
73+
74+
75+
..c:var:: PyTypeObject PyUnicodeIter_Type
76+
77+
This instance of:c:type:`PyTypeObject` represents the Python Unicode
78+
iterator type. It is used to iterate over Unicode string objects.
7379

7480

7581
The following APIs are C macros and static inlined functions for fast checks and
@@ -589,6 +595,14 @@ APIs:
589595
Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
590596
591597
598+
.. c:function:: PyObject* PyUnicode_FromOrdinal(int ordinal)
599+
600+
Create a Unicode Object from the given Unicode code point *ordinal*.
601+
602+
The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is
603+
raised in the case it is not.
604+
605+
592606
.. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \
593607
const char *encoding, const char *errors)
594608
@@ -607,6 +621,16 @@ APIs:
607621
decref'ing the returned objects.
608622
609623
624+
.. c:function:: PyObject* PyUnicode_BuildEncodingMap(PyObject* string)
625+
626+
Return a mapping suitable for decoding a custom single-byte encoding.
627+
Given a Unicode string *string* of up to 256 characters representing an encoding
628+
table, returns either a compact internal mapping object or a dictionary
629+
mapping character ordinals to byte values. Raises a :exc:`TypeError` and
630+
return ``NULL`` on invalid input.
631+
.. versionadded:: 3.2
632+
633+
610634
.. c:function::const char* PyUnicode_GetDefaultEncoding(void)
611635
612636
Return the name of the default string encoding, ``"utf-8"``.

‎Doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@
300300
('py:attr','__annotations__'),
301301
('py:meth','__missing__'),
302302
('py:attr','__wrapped__'),
303-
('py:attr','decimal.Context.clamp'),
304303
('py:meth','index'),# list.index, tuple.index, etc.
305304
]
306305

‎Doc/data/refcounts.dat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,6 +2756,12 @@ PyUnicode_FromFormatV:PyObject*::+1:
27562756
PyUnicode_FromFormatV:const char*:format::
27572757
PyUnicode_FromFormatV:va_list:args::
27582758

2759+
PyUnicode_FromOrdinal:PyObject*::+1:
2760+
PyUnicode_FromOrdinal:int:ordinal::
2761+
2762+
PyUnicode_BuildEncodingMap:PyObject*::+1:
2763+
PyUnicode_BuildEncodingMap:PyObject*:string:::
2764+
27592765
PyUnicode_GetDefaultEncoding:const char*:::
27602766
PyUnicode_GetDefaultEncoding::void::
27612767

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp