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

Commitfe3650c

Browse files
authored
Merge branch 'main' into origin/main
2 parents99ab321 +0e21ed7 commitfe3650c

File tree

299 files changed

+14484
-5278
lines changed

Some content is hidden

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

299 files changed

+14484
-5278
lines changed

‎.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,9 @@ Lib/test/test__colorize.py @hugovk
320320

321321
# Fuzzing
322322
Modules/_xxtestfuzz/@ammaraskar
323+
324+
# t-strings
325+
**/*interpolationobject*@lysnikolaou
326+
**/*templateobject*@lysnikolaou
327+
**/*templatelib*@lysnikolaou
328+
**/*tstring*@lysnikolaou

‎.github/workflows/jit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
114114
brew install llvm@${{ matrix.llvm }}
115115
export SDKROOT="$(xcrun --show-sdk-path)"
116-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
116+
./configure --enable-experimental-jit--enable-universalsdk --with-universal-archs=universal2${{ matrix.debug && '--with-pydebug' || '' }}
117117
make all --jobs 4
118118
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
119119

‎.github/workflows/mypy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ 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/**"
1316
-"Tools/build/generate_sbom.py"
1417
-"Tools/cases_generator/**"
1518
-"Tools/clinic/**"
@@ -42,6 +45,7 @@ jobs:
4245
target:[
4346
"Lib/_pyrepl",
4447
"Lib/test/libregrtest",
48+
"Lib/tomllib",
4549
"Tools/build",
4650
"Tools/cases_generator",
4751
"Tools/clinic",

‎.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

‎.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

‎Doc/c-api/init.rst

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ Cautions regarding runtime finalization
11311131
In the late stage of :term:`interpreter shutdown`, after attempting to wait for
11321132
non-daemon threads to exit (though this can be interrupted by
11331133
:class:`KeyboardInterrupt`) and running the :mod:`atexit` functions, the runtime
1134-
is marked as *finalizing*: :c:func:`_Py_IsFinalizing` and
1134+
is marked as *finalizing*: :c:func:`Py_IsFinalizing` and
11351135
:func:`sys.is_finalizing` return true. At this point, only the *finalization
11361136
thread* that initiated finalization (typically the main thread) is allowed to
11371137
acquire the :term:`GIL`.
@@ -1517,16 +1517,6 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
15171517
.. versionadded:: 3.8
15181518
15191519
1520-
.. c:function:: PyObject* PyUnstable_InterpreterState_GetMainModule(PyInterpreterState *interp)
1521-
1522-
Return a :term:`strong reference` to the ``__main__`` :ref:`module object <moduleobjects>`
1523-
for the given interpreter.
1524-
1525-
The caller must have an :term:`attached thread state`.
1526-
1527-
.. versionadded:: 3.13
1528-
1529-
15301520
.. c:type:: PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag)
15311521
15321522
Type of a frame evaluation function.

‎Doc/c-api/unicode.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ Python:
3333

3434
..c:var:: PyTypeObject PyUnicode_Type
3535
36-
This instance of:c:type:`PyTypeObject` represents the Python Unicode type. It
37-
is exposed to Python code as:py:class:`str`.
36+
This instance of:c:type:`PyTypeObject` represents the Python Unicode type.
37+
It is exposed to Python code as:py:class:`str`.
38+
39+
40+
..c:var:: PyTypeObject PyUnicodeIter_Type
41+
42+
This instance of:c:type:`PyTypeObject` represents the Python Unicode
43+
iterator type. It is used to iterate over Unicode string objects.
3844

3945

4046
..c:type:: Py_UCS4

‎Doc/deprecations/pending-removal-in-3.16.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ Pending removal in Python 3.16
6161
* Calling the Python implementation of:func:`functools.reduce` with *function*
6262
or *sequence* as keyword arguments has been deprecated since Python 3.14.
6363

64+
*:mod:`mimetypes`:
65+
66+
* Valid extensions start with a '.' or are empty for
67+
:meth:`mimetypes.MimeTypes.add_type`.
68+
Undotted extensions are deprecated and will
69+
raise a:exc:`ValueError` in Python 3.16.
70+
(Contributed by Hugo van Kemenade in:gh:`75223`.)
71+
6472
*:mod:`shutil`:
6573

6674
* The:class:`!ExecError` exception

‎Doc/deprecations/pending-removal-in-future.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ although there is currently no date scheduled for their removal.
1313
deprecated.
1414
* The:class:`argparse.FileType` type converter is deprecated.
1515

16-
*:mod:`array`'s ``'u'`` format code (:gh:`57281`)
17-
1816
*:mod:`builtins`:
1917

2018
* ``bool(NotImplemented)``.
@@ -49,6 +47,8 @@ although there is currently no date scheduled for their removal.
4947
:data:`calendar.FEBRUARY`.
5048
(Contributed by Prince Roshan in:gh:`103636`.)
5149

50+
*:mod:`codecs`: use:func:`open` instead of:func:`codecs.open`. (:gh:`133038`)
51+
5252
*:attr:`codeobject.co_lnotab`: use the:meth:`codeobject.co_lines` method
5353
instead.
5454

‎Doc/howto/remote_debugging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ file format structures from the binary file on disk. The ELF header contains a
110110
pointer to the section header table. Each section header contains metadata about
111111
a section including its name (stored in a separate string table), offset, and
112112
size. To find a specific section like .PyRuntime, you need to walk through these
113-
headers and match the section name. The section header thenprovdes the offset
113+
headers and match the section name. The section header thenprovides the offset
114114
where that section exists in the file, which can be used to calculate its
115115
runtime address when the binary is loaded into memory.
116116

‎Doc/library/ast.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,43 @@ Pattern matching
17611761

17621762
..versionadded::3.10
17631763

1764+
1765+
Type annotations
1766+
^^^^^^^^^^^^^^^^
1767+
1768+
..class::TypeIgnore(lineno, tag)
1769+
1770+
A ``# type: ignore`` comment located at *lineno*.
1771+
*tag* is the optional tag specified by the form ``# type: ignore <tag>``.
1772+
1773+
..doctest::
1774+
1775+
>>>print(ast.dump(ast.parse('x = 1 # type: ignore',type_comments=True),indent=4))
1776+
Module(
1777+
body=[
1778+
Assign(
1779+
targets=[
1780+
Name(id='x', ctx=Store())],
1781+
value=Constant(value=1))],
1782+
type_ignores=[
1783+
TypeIgnore(lineno=1, tag='')])
1784+
>>>print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]',type_comments=True),indent=4))
1785+
Module(
1786+
body=[
1787+
AnnAssign(
1788+
target=Name(id='x', ctx=Store()),
1789+
annotation=Name(id='bool', ctx=Load()),
1790+
value=Constant(value=1),
1791+
simple=1)],
1792+
type_ignores=[
1793+
TypeIgnore(lineno=1, tag='[assignment]')])
1794+
1795+
..note::
1796+
:class:`!TypeIgnore` nodes are not generated when the *type_comments* parameter
1797+
is set to ``False`` (default). See:func:`ast.parse` for more details.
1798+
1799+
..versionadded::3.8
1800+
17641801
.. _ast-type-params:
17651802

17661803
Type parameters

‎Doc/library/codecs.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ wider range of codecs when working with binary files:
208208
..versionchanged::3.11
209209
The ``'U'`` mode has been removed.
210210

211+
..deprecated::next
212+
213+
:func:`codecs.open` has been superseded by:func:`open`.
214+
211215

212216
..function::EncodedFile(file, data_encoding, file_encoding=None, errors='strict')
213217

‎Doc/library/decimal.rst

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,14 @@ function to temporarily change the active context.
10311031
..versionchanged::3.11
10321032
:meth:`localcontext` now supports setting context attributes through the use of keyword arguments.
10331033

1034+
..function::IEEEContext(bits)
1035+
1036+
Return a context object initialized to the proper values for one of the
1037+
IEEE interchange formats. The argument must be a multiple of 32 and less
1038+
than:const:`IEEE_CONTEXT_MAX_BITS`.
1039+
1040+
..versionadded::next
1041+
10341042
New contexts can also be created using the:class:`Context` constructor
10351043
described below. In addition, the module provides three pre-made contexts:
10361044

@@ -1552,18 +1560,19 @@ Constants
15521560
The constants in this section are only relevant for the C module. They
15531561
are also included in the pure Python version for compatibility.
15541562

1555-
+---------------------+---------------------+-------------------------------+
1556-
|| 32-bit| 64-bit|
1557-
+=====================+=====================+===============================+
1558-
| .. data:: MAX_PREC| ``425000000``| ``999999999999999999``|
1559-
+---------------------+---------------------+-------------------------------+
1560-
| .. data:: MAX_EMAX| ``425000000``| ``999999999999999999``|
1561-
+---------------------+---------------------+-------------------------------+
1562-
| .. data:: MIN_EMIN| ``-425000000``| ``-999999999999999999``|
1563-
+---------------------+---------------------+-------------------------------+
1564-
| .. data:: MIN_ETINY| ``-849999999``| ``-1999999999999999997``|
1565-
+---------------------+---------------------+-------------------------------+
1566-
1563+
+---------------------------------+---------------------+-------------------------------+
1564+
|| 32-bit| 64-bit|
1565+
+=================================+=====================+===============================+
1566+
| .. data:: MAX_PREC| ``425000000``| ``999999999999999999``|
1567+
+---------------------------------+---------------------+-------------------------------+
1568+
| .. data:: MAX_EMAX| ``425000000``| ``999999999999999999``|
1569+
+---------------------------------+---------------------+-------------------------------+
1570+
| .. data:: MIN_EMIN| ``-425000000``| ``-999999999999999999``|
1571+
+---------------------------------+---------------------+-------------------------------+
1572+
| .. data:: MIN_ETINY| ``-849999999``| ``-1999999999999999997``|
1573+
+---------------------------------+---------------------+-------------------------------+
1574+
| .. data:: IEEE_CONTEXT_MAX_BITS| ``256``| ``512``|
1575+
+---------------------------------+---------------------+-------------------------------+
15671576

15681577
..data::HAVE_THREADS
15691578

‎Doc/library/exceptions.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,13 +428,17 @@ The following exceptions are the exceptions that are usually raised.
428428
:exc:`PythonFinalizationError` during the Python finalization:
429429

430430
* Creating a new Python thread.
431+
*:meth:`Joining <threading.Thread.join>` a running daemon thread.
431432
*:func:`os.fork`.
432433

433434
See also the:func:`sys.is_finalizing` function.
434435

435436
..versionadded::3.13
436437
Previously, a plain:exc:`RuntimeError` was raised.
437438

439+
..versionchanged::next
440+
441+
:meth:`threading.Thread.join` can now raise this exception.
438442

439443
..exception::RecursionError
440444

‎Doc/library/faulthandler.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ Dumping the C stack
8484
C Stack Compatibility
8585
*********************
8686

87-
If the system does not support the C-level:manpage:`backtrace(3)`,
88-
:manpage:`backtrace_symbols(3)`,or:manpage:`dladdr(3)`, then C stack dumps
89-
will not work.An error will be printed instead of the stack.
87+
If the system does not support the C-level:manpage:`backtrace(3)`
88+
or:manpage:`dladdr1(3)`, then C stack dumps will not work.
89+
An error will be printed instead of the stack.
9090

9191
Additionally, some compilers do not support:term:`CPython's <CPython>`
9292
implementation of C stack dumps. As a result, a different error may be printed

‎Doc/library/importlib.metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Distribution files
297297
package is not installed in the current Python environment.
298298

299299
Returns:const:`None` if the distribution is found but the installation
300-
database records reporting the files associated with thedistribuion package
300+
database records reporting the files associated with thedistribution package
301301
are missing.
302302

303303
..class::PackagePath

‎Doc/library/mimetypes.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,18 @@ than one MIME-type database; it provides an interface similar to the one of the
301301

302302
..method::MimeTypes.add_type(type, ext, strict=True)
303303

304-
Add a mapping from the MIME type *type* to the extension *ext*. When the
304+
Add a mapping from the MIME type *type* to the extension *ext*.
305+
Valid extensions start with a '.' or are empty. When the
305306
extension is already known, the new type will replace the old one. When the type
306307
is already known the extension will be added to the list of known extensions.
307308

308309
When *strict* is ``True`` (the default), the mapping will be added to the
309310
official MIME types, otherwise to the non-standard ones.
310311

312+
..deprecated-removed::3.14 3.16
313+
Invalid, undotted extensions will raise a
314+
:exc:`ValueError` in Python 3.16.
315+
311316

312317
.. _mimetypes-cli:
313318

‎Doc/library/pdb.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,21 @@ slightly different way:
188188
..versionadded::3.14
189189
The *commands* argument.
190190

191+
192+
..awaitablefunction::set_trace_async(*, header=None, commands=None)
193+
194+
async version of:func:`set_trace`. This function should be used inside an
195+
async function with:keyword:`await`.
196+
197+
..code-block::python
198+
199+
asyncdeff():
200+
await pdb.set_trace_async()
201+
202+
:keyword:`await` statements are supported if the debugger is invoked by this function.
203+
204+
..versionadded::3.14
205+
191206
..function::post_mortem(t=None)
192207

193208
Enter post-mortem debugging of the given exception or

‎Doc/library/string.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,18 @@ implementation as the built-in :meth:`~str.format` method.
131131
(which can happen if two replacement fields occur consecutively), then
132132
*literal_text* will be a zero-length string. If there is no replacement
133133
field, then the values of *field_name*, *format_spec* and *conversion*
134-
will be ``None``.
134+
will be ``None``. The value of *field_name* is unmodified and
135+
auto-numbering of non-numbered positional fields is done by:meth:`vformat`.
135136

136137
..method::get_field(field_name, args, kwargs)
137138

138-
Given *field_name* as returned by:meth:`parse` (see above), convert it to
139-
an object to be formatted. Returns a tuple (obj, used_key). The default
140-
version takes strings of the form defined in:pep:`3101`, such as
141-
"0[name]" or "label.title". *args* and *kwargs* are as passed in to
142-
:meth:`vformat`. The return value *used_key* has the same meaning as the
143-
*key* parameter to:meth:`get_value`.
139+
Given *field_name*, convert it to an object to be formatted.
140+
Auto-numbering of *field_name* returned from:meth:`parse` is done by
141+
:meth:`vformat` before calling this method. Returns a tuple (obj, used_key).
142+
The default version takes strings of the form defined in:pep:`3101`,
143+
such as "0[name]" or "label.title". *args* and *kwargs* are as passed in to
144+
:meth:`vformat`. The return value *used_key* has the same meaning
145+
as the *key* parameter to:meth:`get_value`.
144146

145147
..method::get_value(key, args, kwargs)
146148

‎Doc/library/sysconfig.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,10 @@ Other functions
429429
Return the path of:file:`Makefile`.
430430

431431
.. _sysconfig-cli:
432+
.. _using-sysconfig-as-a-script:
432433

433-
Using:mod:`sysconfig` as a script
434-
----------------------------------
434+
Command-line usage
435+
------------------
435436

436437
You can use:mod:`sysconfig` as a script with Python's *-m* option:
437438

‎Doc/library/tarfile.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Some facts and figures:
112112
``'w|bz2'``,:func:`tarfile.open` accepts the keyword argument
113113
*compresslevel* (default ``9``) to specify the compression level of the file.
114114

115-
For modes ``'w:xz'`` and``'x:xz'``,:func:`tarfile.open` accepts the
115+
For modes ``'w:xz'``,``'x:xz'`` and ``'w|xz'``,:func:`tarfile.open` accepts the
116116
keyword argument *preset* to specify the compression level of the file.
117117

118118
For special purposes, there is a second format for *mode*:
@@ -167,6 +167,9 @@ Some facts and figures:
167167
..versionchanged::3.12
168168
The *compresslevel* keyword argument also works for streams.
169169

170+
..versionchanged::next
171+
The *preset* keyword argument also works for streams.
172+
170173

171174
..class::TarFile
172175
:noindex:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp