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

Commit0ef3fb7

Browse files
authored
Merge branch 'main' into fix-for-stmt-docs
2 parents9af4d49 +e3dda8f commit0ef3fb7

File tree

90 files changed

+2128
-736
lines changed

Some content is hidden

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

90 files changed

+2128
-736
lines changed

‎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/faq/design.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,12 @@ strings representing the files in the current directory. Functions which
420420
operate on this output would generally not break if you added another file or
421421
two to the directory.
422422

423-
Tuples are immutable, meaning that once a tuple has been created, you can't
424-
replace any of its elements with a new value. Lists are mutable, meaning that
425-
you can always change a list's elements. Only immutable elements can be used as
426-
dictionary keys, and hence only tuples and not lists can be used as keys.
423+
Tuples are:term:`immutable`, meaning that once a tuple has been created, you can't
424+
replace any of its elements with a new value. Lists are:term:`mutable`, meaning that
425+
you can always change a list's elements. Only:term:`hashable` objects can
426+
be used as dictionary keys. Most immutable types are hashable, which is why
427+
tuples, but not lists, can be used as keys. Note, however, that a tuple is
428+
only hashable if all of its elements are hashable.
427429

428430

429431
How are lists implemented in CPython?

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ You can use it to enable code that only runs under the free-threaded build::
2323
/* code that only runs in the free-threaded build */
2424
#endif
2525

26+
..note::
27+
28+
On Windows, this macro is not defined automatically, but must be specified
29+
to the compiler when building. The:func:`sysconfig.get_config_var` function
30+
can be used to determine whether the current running interpreter had the
31+
macro defined.
32+
33+
2634
Module Initialization
2735
=====================
2836

‎Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ have the form::
372372
for expr2 in sequence2
373373
if condition2
374374
for expr3 in sequence3
375-
...
376375
if condition3
376+
...
377377
for exprN in sequenceN
378378
if conditionN )
379379

‎Doc/library/base64.rst

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,17 @@
1515

1616
This module provides functions for encoding binary data to printable
1717
ASCII characters and decoding such encodings back to binary data.
18-
It provides encoding and decoding functions for the encodings specified in
19-
:rfc:`4648`, which defines the Base16, Base32, and Base64 algorithms,
20-
and for the de-facto standard Ascii85 and Base85 encodings.
21-
22-
The:rfc:`4648` encodings are suitable for encoding binary data so that it can be
23-
safely sent by email, used as parts of URLs, or included as part of an HTTP
24-
POST request. The encoding algorithm is not the same as the
25-
:program:`uuencode` program.
18+
This includes the:ref:`encodings specified in<base64-rfc-4648>`
19+
:rfc:`4648` (Base64, Base32 and Base16)
20+
and the non-standard:ref:`Base85 encodings<base64-base-85>`.
2621

2722
There are two interfaces provided by this module. The modern interface
2823
supports encoding:term:`bytes-like objects <bytes-like object>` to ASCII
2924
:class:`bytes`, and decoding:term:`bytes-like objects <bytes-like object>` or
3025
strings containing ASCII to:class:`bytes`. Both base-64 alphabets
3126
defined in:rfc:`4648` (normal, and URL- and filesystem-safe) are supported.
3227

33-
The legacy interface does not support decoding from strings, but it does
28+
The:ref:`legacy interface<base64-legacy>` does not support decoding from strings, but it does
3429
provide functions for encoding and decoding to and from:term:`file objects
3530
<file object>`. It only supports the Base64 standard alphabet, and it adds
3631
newlines every 76 characters as per:rfc:`2045`. Note that if you are looking
@@ -46,7 +41,15 @@ package instead.
4641
Any:term:`bytes-like objects <bytes-like object>` are now accepted by all
4742
encoding and decoding functions in this module. Ascii85/Base85 support added.
4843

49-
The modern interface provides:
44+
45+
.. _base64-rfc-4648:
46+
47+
RFC 4648 Encodings
48+
------------------
49+
50+
The:rfc:`4648` encodings are suitable for encoding binary data so that it can be
51+
safely sent by email, used as parts of URLs, or included as part of an HTTP
52+
POST request.
5053

5154
..function::b64encode(s, altchars=None)
5255

@@ -181,6 +184,26 @@ The modern interface provides:
181184
incorrectly padded or if there are non-alphabet characters present in the
182185
input.
183186

187+
.. _base64-base-85:
188+
189+
Base85 Encodings
190+
-----------------
191+
192+
Base85 encoding is not formally specified but rather a de facto standard,
193+
thus different systems perform the encoding differently.
194+
195+
The:func:`a85encode` and:func:`b85encode` functions in this module are two implementations of
196+
the de facto standard. You should call the function with the Base85
197+
implementation used by the software you intend to work with.
198+
199+
The two functions present in this module differ in how they handle the following:
200+
201+
* Whether to include enclosing ``<~`` and ``~>`` markers
202+
* Whether to include newline characters
203+
* The set of ASCII characters used for encoding
204+
* Handling of null bytes
205+
206+
Refer to the documentation of the individual functions for more information.
184207

185208
..function::a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False)
186209

@@ -262,7 +285,10 @@ The modern interface provides:
262285
..versionadded::3.13
263286

264287

265-
The legacy interface:
288+
.. _base64-legacy:
289+
290+
Legacy Interface
291+
----------------
266292

267293
..function::decode(input, output)
268294

‎Doc/library/multiprocessing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,12 @@ object -- see :ref:`multiprocessing-managers`.
13691369
A solitary difference from its close analog exists: its ``acquire`` method's
13701370
first argument is named *block*, as is consistent with:meth:`Lock.acquire`.
13711371

1372+
..method::locked()
1373+
1374+
Return a boolean indicating whether this object is locked right now.
1375+
1376+
..versionadded::3.14
1377+
13721378
..note::
13731379
On macOS, this is indistinguishable from:class:`Semaphore` because
13741380
``sem_getvalue()`` is not implemented on that platform.
@@ -1521,6 +1527,12 @@ object -- see :ref:`multiprocessing-managers`.
15211527
A solitary difference from its close analog exists: its ``acquire`` method's
15221528
first argument is named *block*, as is consistent with:meth:`Lock.acquire`.
15231529

1530+
..method::locked()
1531+
1532+
Return a boolean indicating whether this object is locked right now.
1533+
1534+
..versionadded::3.14
1535+
15241536
..note::
15251537

15261538
On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with

‎Doc/library/re.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,8 @@ Functions
991991
That way, separator components are always found at the same relative
992992
indices within the result list.
993993

994-
Emptymatchesfor the pattern split the string only when not adjacent
995-
to a previousempty match.
994+
Adjacent emptymatchesare not possible, but an empty match can occur
995+
immediately after a non-empty match.
996996

997997
..code::pycon
998998
@@ -1095,9 +1095,12 @@ Functions
10951095

10961096
The optional argument *count* is the maximum number of pattern occurrences to be
10971097
replaced; *count* must be a non-negative integer. If omitted or zero, all
1098-
occurrences will be replaced. Empty matches for the pattern are replaced only
1099-
when not adjacent to a previous empty match, so ``sub('x*', '-', 'abxd')`` returns
1100-
``'-a-b--d-'``.
1098+
occurrences will be replaced.
1099+
1100+
Adjacent empty matches are not possible, but an empty match can occur
1101+
immediately after a non-empty match.
1102+
As a result, ``sub('x*', '-', 'abxd')`` returns ``'-a-b--d-'``
1103+
instead of ``'-a-b-d-'``.
11011104

11021105
..index::single: \g; in regular expressions
11031106

@@ -1128,8 +1131,7 @@ Functions
11281131
..versionchanged::3.7
11291132
Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
11301133
now are errors.
1131-
Empty matches for the pattern are replaced when adjacent to a previous
1132-
non-empty match.
1134+
An empty match can occur immediately after a non-empty match.
11331135

11341136
..versionchanged::3.12
11351137
Group *id* can only contain ASCII digits.

‎Doc/library/socketserver.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ There are four basic concrete server classes:
2424
:meth:`~BaseServer.server_activate`. The other parameters are passed to
2525
the:class:`BaseServer` base class.
2626

27+
..versionchanged::next
28+
The default queue size is now ``socket.SOMAXCONN`` for:class:`socketserver.TCPServer`.
2729

2830
..class::UDPServer(server_address, RequestHandlerClass, bind_and_activate=True)
2931

‎Doc/tutorial/controlflow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ Here is an example of a multi-line docstring::
10561056
>>> print(my_function.__doc__)
10571057
Do nothing, but document it.
10581058

1059-
No, really, it doesn't do anything.
1059+
No, really, it doesn't do anything.
10601060

10611061

10621062
.. _tut-annotations:

‎Doc/whatsnew/3.14.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,12 @@ Kumar Aditya, Edgar Margffoy, and many others.
829829
Some of these contributors are employed by Meta, which has continued to provide
830830
significant engineering resources to support this project.
831831

832+
From 3.14, when compiling extension modules for the free-threaded build of
833+
CPython on Windows, the preprocessor variable ``Py_GIL_DISABLED`` now needs to
834+
be specified by the build backend, as it will no longer be determined
835+
automatically by the C compiler. For a running interpreter, the setting that
836+
was used at compile time can be found using:func:`sysconfig.get_config_var`.
837+
832838

833839
.. _whatsnew314-pyrepl-highlighting:
834840

‎Doc/whatsnew/3.15.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ sysconfig
145145
(Contributed by Filipe Laíns in:gh:`92897`.)
146146

147147

148+
threading
149+
---------
150+
151+
* Remove support for arbitrary positional or keyword arguments in the C
152+
implementation of:class:`~threading.RLock` objects. This was deprecated
153+
in Python 3.14.
154+
(Contributed by Bénédikt Tran in:gh:`134087`.)
155+
156+
148157
typing
149158
------
150159

‎Include/Python.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
# include<intrin.h>// __readgsqword()
6060
#endif
6161

62+
// Suppress known warnings in Python header files.
63+
#if defined(_MSC_VER)
64+
// Warning that alignas behaviour has changed. Doesn't affect us, because we
65+
// never relied on the old behaviour.
66+
#pragma warning(push)
67+
#pragma warning(disable: 5274)
68+
#endif
69+
6270
// Include Python header files
6371
#include"pyport.h"
6472
#include"pymacro.h"
@@ -138,4 +146,9 @@
138146
#include"cpython/pyfpe.h"
139147
#include"cpython/tracemalloc.h"
140148

149+
// Restore warning filter
150+
#ifdef_MSC_VER
151+
#pragma warning(pop)
152+
#endif
153+
141154
#endif/* !Py_PYTHON_H */

‎Include/internal/pycore_opcode_metadata.h

Lines changed: 31 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp