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

Commitda0750d

Browse files
authored
Merge branch 'main' into issue-129667
2 parents3dd34eb +285c1c4 commitda0750d

File tree

109 files changed

+3730
-1737
lines changed

Some content is hidden

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

109 files changed

+3730
-1737
lines changed

‎Doc/c-api/init.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ Process-wide parameters
622622
It now returns ``NULL`` if called before:c:func:`Py_Initialize`.
623623
624624
..deprecated-removed::3.13 3.15
625-
Get:data:`sys.executable` instead.
625+
Use:c:func:`PyConfig_Get("executable") <PyConfig_Get>`
626+
(:data:`sys.executable`) instead.
626627
627628
628629
.. c:function:: wchar_t* Py_GetPrefix()
@@ -644,8 +645,10 @@ Process-wide parameters
644645
It now returns ``NULL`` if called before:c:func:`Py_Initialize`.
645646
646647
..deprecated-removed::3.13 3.15
647-
Get:data:`sys.base_prefix` instead, or:data:`sys.prefix` if
648-
:ref:`virtual environments<venv-def>` need to be handled.
648+
Use:c:func:`PyConfig_Get("base_prefix") <PyConfig_Get>`
649+
(:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get("prefix")
650+
<PyConfig_Get>` (:data:`sys.prefix`) if :ref:`virtual environments
651+
<venv-def>` need to be handled.
649652
650653
651654
.. c:function:: wchar_t* Py_GetExecPrefix()
@@ -690,9 +693,11 @@ Process-wide parameters
690693
It now returns ``NULL`` if called before:c:func:`Py_Initialize`.
691694

692695
..deprecated-removed::3.13 3.15
693-
Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if
694-
:ref:`virtual environments <venv-def>` need to be handled.
695-
696+
Use:c:func:`PyConfig_Get("base_exec_prefix") <PyConfig_Get>`
697+
(:data:`sys.base_exec_prefix`) instead. Use
698+
:c:func:`PyConfig_Get("exec_prefix") <PyConfig_Get>`
699+
(:data:`sys.exec_prefix`) if:ref:`virtual environments<venv-def>` need
700+
to be handled.
696701

697702
..c:function::wchar_t*Py_GetProgramFullPath()
698703
@@ -712,7 +717,8 @@ Process-wide parameters
712717
It now returns ``NULL`` if called before:c:func:`Py_Initialize`.
713718

714719
..deprecated-removed::3.13 3.15
715-
Get:data:`sys.executable` instead.
720+
Use:c:func:`PyConfig_Get("executable") <PyConfig_Get>`
721+
(:data:`sys.executable`) instead.
716722

717723

718724
..c:function::wchar_t*Py_GetPath()
@@ -740,8 +746,8 @@ Process-wide parameters
740746
It now returns ``NULL`` if called before:c:func:`Py_Initialize`.
741747

742748
..deprecated-removed::3.13 3.15
743-
Get:data:`sys.path` instead.
744-
749+
Use:c:func:`PyConfig_Get("module_search_paths") <PyConfig_Get>`
750+
(:data:`sys.path`) instead.
745751

746752
..c:function::constchar*Py_GetVersion()
747753
@@ -926,8 +932,8 @@ Process-wide parameters
926932
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
927933
928934
.. deprecated-removed:: 3.13 3.15
929-
Get :c:member:`PyConfig.home` or:envvar:`PYTHONHOME` environment
930-
variable instead.
935+
Use :c:func:`PyConfig_Get("home") <PyConfig_Get>` orthe
936+
:envvar:`PYTHONHOME` environmentvariable instead.
931937
932938
933939
.. _threads:

‎Doc/c-api/module.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,6 @@ state:
523523
524524
On success, return ``0``. On error, raise an exception and return ``-1``.
525525
526-
Return ``-1`` if *value* is ``NULL``. It must be called with an exception
527-
raised in this case.
528-
529526
Example usage::
530527
531528
static int
@@ -540,6 +537,10 @@ state:
540537
return res;
541538
}
542539
540+
To be convenient, the function accepts ``NULL`` *value* with an exception
541+
set. In this case, return ``-1`` and just leave the raised exception
542+
unchanged.
543+
543544
The example can also be written without checking explicitly if *obj* is
544545
``NULL``::
545546

‎Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
'changes',
2929
'glossary_search',
3030
'lexers',
31+
'misc_news',
3132
'pydoc_topics',
3233
'pyspecific',
3334
'sphinx.ext.coverage',

‎Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎Doc/deprecations/c-api-pending-removal-in-3.15.rst

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,35 @@ Pending removal in Python 3.15
1010
:c:func:`PyWeakref_GetRef` on Python 3.12 and older.
1111
*:c:type:`Py_UNICODE` type and the:c:macro:`!Py_UNICODE_WIDE` macro:
1212
Use:c:type:`wchar_t` instead.
13-
* Python initialization functions:
13+
* Python initialization functions, deprecated in Python 3.13:
1414

15-
*:c:func:`PySys_ResetWarnOptions`:
16-
Clear:data:`sys.warnoptions` and:data:`!warnings.filters` instead.
17-
*:c:func:`Py_GetExecPrefix`:
18-
Get:data:`sys.base_exec_prefix` and:data:`sys.exec_prefix` instead.
1915
*:c:func:`Py_GetPath`:
20-
Get:data:`sys.path` instead.
16+
Use:c:func:`PyConfig_Get("module_search_paths") <PyConfig_Get>`
17+
(:data:`sys.path`) instead.
2118
*:c:func:`Py_GetPrefix`:
22-
Get:data:`sys.base_prefix` and:data:`sys.prefix` instead.
19+
Use:c:func:`PyConfig_Get("base_prefix") <PyConfig_Get>`
20+
(:data:`sys.base_prefix`) instead. Use:c:func:`PyConfig_Get("prefix")
21+
<PyConfig_Get>` (:data:`sys.prefix`) if:ref:`virtual environments
22+
<venv-def>` need to be handled.
23+
*:c:func:`Py_GetExecPrefix`:
24+
Use:c:func:`PyConfig_Get("base_exec_prefix") <PyConfig_Get>`
25+
(:data:`sys.base_exec_prefix`) instead. Use
26+
:c:func:`PyConfig_Get("exec_prefix") <PyConfig_Get>`
27+
(:data:`sys.exec_prefix`) if:ref:`virtual environments<venv-def>` need to
28+
be handled.
2329
*:c:func:`Py_GetProgramFullPath`:
24-
Get:data:`sys.executable` instead.
30+
Use:c:func:`PyConfig_Get("executable") <PyConfig_Get>`
31+
(:data:`sys.executable`) instead.
2532
*:c:func:`Py_GetProgramName`:
26-
Get:data:`sys.executable` instead.
33+
Use:c:func:`PyConfig_Get("executable") <PyConfig_Get>`
34+
(:data:`sys.executable`) instead.
2735
*:c:func:`Py_GetPythonHome`:
28-
Get:c:func:`PyConfig_Get("home") <PyConfig_Get>`
29-
or the:envvar:`PYTHONHOME` environment variable instead.
36+
Use:c:func:`PyConfig_Get("home") <PyConfig_Get>` or the
37+
:envvar:`PYTHONHOME` environment variable instead.
3038

31-
See also the:c:func:`PyConfig_Get` function.
39+
The `pythoncapi-compat project
40+
<https://github.com/python/pythoncapi-compat/>`__ can be used to get
41+
:c:func:`PyConfig_Get` on Python 3.13 and older.
3242

3343
* Functions to configure Python's initialization, deprecated in Python 3.11:
3444

@@ -40,6 +50,8 @@ Pending removal in Python 3.15
4050
Set:c:member:`PyConfig.program_name` instead.
4151
*:c:func:`!Py_SetPythonHome()`:
4252
Set:c:member:`PyConfig.home` instead.
53+
*:c:func:`PySys_ResetWarnOptions`:
54+
Clear:data:`sys.warnoptions` and:data:`!warnings.filters` instead.
4355

4456
The:c:func:`Py_InitializeFromConfig` API should be used with
4557
:c:type:`PyConfig` instead.

‎Doc/howto/free-threading-python.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Identifying free-threaded Python
4343
================================
4444

4545
To check if the current interpreter supports free-threading,:option:`python -VV <-V>`
46-
and:attr:`sys.version` contain "experimental free-threading build".
46+
and:data:`sys.version` contain "experimental free-threading build".
4747
The new:func:`sys._is_gil_enabled` function can be used to check whether
4848
the GIL is actually disabled in the running process.
4949

‎Doc/library/datetime.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The :mod:`!datetime` module exports the following constants:
9393
The largest year number allowed in a:class:`date` or:class:`.datetime` object.
9494
:const:`MAXYEAR` is 9999.
9595

96-
..attribute::UTC
96+
..data::UTC
9797

9898
Alias for the UTC time zone singleton:attr:`datetime.timezone.utc`.
9999

@@ -970,7 +970,7 @@ Other constructors, all class methods:
970970

971971
..deprecated::3.12
972972

973-
Use:meth:`datetime.now` with:attr:`UTC` instead.
973+
Use:meth:`datetime.now` with:const:`UTC` instead.
974974

975975

976976
..classmethod::datetime.fromtimestamp(timestamp, tz=None)
@@ -1042,7 +1042,7 @@ Other constructors, all class methods:
10421042

10431043
..deprecated::3.12
10441044

1045-
Use:meth:`datetime.fromtimestamp` with:attr:`UTC` instead.
1045+
Use:meth:`datetime.fromtimestamp` with:const:`UTC` instead.
10461046

10471047

10481048
..classmethod::datetime.fromordinal(ordinal)

‎Doc/library/decimal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,7 @@ value for :attr:`~Context.prec` as well [#]_::
22622262
Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')
22632263

22642264

2265-
For inexact results,:attr:`MAX_PREC` is far too large on 64-bit platforms and
2265+
For inexact results,:const:`MAX_PREC` is far too large on 64-bit platforms and
22662266
the available memory will be insufficient::
22672267

22682268
>>> Decimal(1) / 3

‎Doc/library/exceptions.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,13 @@ The following exceptions are the exceptions that are usually raised.
562562

563563
Raised when the interpreter finds an internal error, but the situation does not
564564
look so serious to cause it to abandon all hope. The associated value is a
565-
string indicating what went wrong (in low-level terms).
565+
string indicating what went wrong (in low-level terms). In:term:`CPython`,
566+
this could be raised by incorrectly using Python's C API, such as returning
567+
a ``NULL`` value without an exception set.
566568

567-
You should report this to the author or maintainer of your Python interpreter.
569+
If you're confident that this exception wasn't your fault, or the fault of
570+
a package you're using, you should report this to the author or maintainer
571+
of your Python interpreter.
568572
Be sure to report the version of the Python interpreter (``sys.version``; it is
569573
also printed at the start of an interactive Python session), the exact error
570574
message (the exception's associated value) and if possible the source of the

‎Doc/library/filecmp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ The :class:`dircmp` class
189189
are the same type as *self*, if *self* is a subclass of
190190
:class:`dircmp`.
191191

192-
..attribute::DEFAULT_IGNORES
192+
..data::DEFAULT_IGNORES
193193

194194
..versionadded::3.4
195195

‎Doc/library/importlib.metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ Mapping import to distribution packages
375375
..function::packages_distributions()
376376

377377
Return a mapping from the top level module and import package
378-
names found via:attr:`sys.meta_path` to the names of the distribution
378+
names found via:data:`sys.meta_path` to the names of the distribution
379379
packages (if any) that provide the corresponding files.
380380

381381
To allow for namespace packages (which may have members provided by

‎Doc/library/importlib.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ ABC hierarchy::
746746
suitable for reading (same as:attr:`pathlib.Path.open`).
747747

748748
When opening as text, accepts encoding parameters such as those
749-
accepted by:attr:`io.TextIOWrapper`.
749+
accepted by:class:`io.TextIOWrapper`.
750750

751751
..method::read_bytes()
752752

@@ -794,34 +794,34 @@ ABC hierarchy::
794794
This module contains the various objects that help:keyword:`import`
795795
find and load modules.
796796

797-
..attribute::SOURCE_SUFFIXES
797+
..data::SOURCE_SUFFIXES
798798

799799
A list of strings representing the recognized file suffixes for source
800800
modules.
801801

802802
..versionadded::3.3
803803

804-
..attribute::DEBUG_BYTECODE_SUFFIXES
804+
..data::DEBUG_BYTECODE_SUFFIXES
805805

806806
A list of strings representing the file suffixes for non-optimized bytecode
807807
modules.
808808

809809
..versionadded::3.3
810810

811811
..deprecated::3.5
812-
Use:attr:`BYTECODE_SUFFIXES` instead.
812+
Use:const:`BYTECODE_SUFFIXES` instead.
813813

814-
..attribute::OPTIMIZED_BYTECODE_SUFFIXES
814+
..data::OPTIMIZED_BYTECODE_SUFFIXES
815815

816816
A list of strings representing the file suffixes for optimized bytecode
817817
modules.
818818

819819
..versionadded::3.3
820820

821821
..deprecated::3.5
822-
Use:attr:`BYTECODE_SUFFIXES` instead.
822+
Use:const:`BYTECODE_SUFFIXES` instead.
823823

824-
..attribute::BYTECODE_SUFFIXES
824+
..data::BYTECODE_SUFFIXES
825825

826826
A list of strings representing the recognized file suffixes for bytecode
827827
modules (including the leading dot).
@@ -831,7 +831,7 @@ find and load modules.
831831
..versionchanged::3.5
832832
The value is no longer dependent on ``__debug__``.
833833

834-
..attribute::EXTENSION_SUFFIXES
834+
..data::EXTENSION_SUFFIXES
835835

836836
A list of strings representing the recognized file suffixes for
837837
extension modules.
@@ -1109,7 +1109,7 @@ find and load modules.
11091109
..method::is_package(fullname)
11101110

11111111
Returns ``True`` if the file path points to a package's ``__init__``
1112-
module based on:attr:`EXTENSION_SUFFIXES`.
1112+
module based on:const:`EXTENSION_SUFFIXES`.
11131113

11141114
..method::get_code(fullname)
11151115

@@ -1294,7 +1294,7 @@ find and load modules.
12941294
This module contains the various objects that help in the construction of
12951295
an:term:`importer`.
12961296

1297-
..attribute::MAGIC_NUMBER
1297+
..data::MAGIC_NUMBER
12981298

12991299
The bytes which represent the bytecode version number. If you need help with
13001300
loading/writing bytecode then consider:class:`importlib.abc.SourceLoader`.

‎Doc/library/logging.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ in a module, ``__name__`` is the module's name in the Python package namespace.
342342

343343
If no handler is attached to this logger (or any of its ancestors,
344344
taking into account the relevant:attr:`Logger.propagate` attributes),
345-
the message will be sent to the handler set on:attr:`lastResort`.
345+
the message will be sent to the handler set on:data:`lastResort`.
346346

347347
..versionchanged::3.2
348348
The *stack_info* parameter was added.
@@ -1495,7 +1495,7 @@ functions.
14951495
Module-Level Attributes
14961496
-----------------------
14971497

1498-
..attribute::lastResort
1498+
..data::lastResort
14991499

15001500
A "handler of last resort" is available through this attribute. This
15011501
is a:class:`StreamHandler` writing to ``sys.stderr`` with a level of
@@ -1507,7 +1507,7 @@ Module-Level Attributes
15071507

15081508
..versionadded::3.2
15091509

1510-
..attribute::raiseExceptions
1510+
..data::raiseExceptions
15111511

15121512
Used to see if exceptions during handling should be propagated.
15131513

‎Doc/library/mimetypes.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ the information :func:`init` sets up.
4747
The optional *strict* argument is a flag specifying whether the list of known MIME types
4848
is limited to only the official types `registered with IANA
4949
<https://www.iana.org/assignments/media-types/media-types.xhtml>`_.
50-
When *strict* is ``True`` (the default), only the IANA types are supported; when
51-
*strict* is ``False``, some additional non-standard but commonly used MIME types
52-
are also recognized.
50+
However, the behavior of this module also depends on the underlying operating
51+
system. Only file types recognized by the OS or explicitly registered with
52+
Python's internal database can be identified. When *strict* is ``True`` (the
53+
default), only the IANA types are supported; when *strict* is ``False``, some
54+
additional non-standard but commonly used MIME types are also recognized.
5355

5456
..versionchanged::3.8
5557
Added support for *url* being a:term:`path-like object`.

‎Doc/library/plistlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This module defines the following functions:
7171

7272
When *aware_datetime* is true, fields with type ``datetime.datetime`` will
7373
be created as:ref:`aware object<datetime-naive-aware>`, with
74-
:attr:`!tzinfo` as:attr:`datetime.UTC`.
74+
:attr:`!tzinfo` as:const:`datetime.UTC`.
7575

7676
XML data for the:data:`FMT_XML` format is parsed using the Expat parser
7777
from:mod:`xml.parsers.expat` -- see its documentation for possible

‎Doc/library/select.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The module defines the following:
165165
:exc:`InterruptedError`.
166166

167167

168-
..attribute::PIPE_BUF
168+
..data::PIPE_BUF
169169

170170
The minimum number of bytes which can be written without blocking to a pipe
171171
when the pipe has been reported as ready for writing by:func:`~select.select`,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp