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

Commitddc44b8

Browse files
Merge branch 'main' into fix-blocksize-in-sendfile
2 parents88367ab +d4dfad2 commitddc44b8

File tree

340 files changed

+5470
-9056
lines changed

Some content is hidden

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

340 files changed

+5470
-9056
lines changed

‎.cirrus-DISABLED.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ jobs:
142142
run:echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
143143
-name:Configure ccache action
144144
uses:hendrikmuhs/ccache-action@v1.2
145+
with:
146+
save:false
145147
-name:Check Autoconf and aclocal versions
146148
run:|
147149
grep "Generated by GNU Autoconf 2.71" configure
@@ -284,6 +286,8 @@ jobs:
284286
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
285287
-name:Configure ccache action
286288
uses:hendrikmuhs/ccache-action@v1.2
289+
with:
290+
save:false
287291
-name:Configure CPython
288292
run:./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
289293
-name:Build CPython
@@ -327,6 +331,8 @@ jobs:
327331
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
328332
-name:Configure ccache action
329333
uses:hendrikmuhs/ccache-action@v1.2
334+
with:
335+
save:false
330336
-name:Setup directory envs for out-of-tree builds
331337
run:|
332338
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
@@ -446,6 +452,8 @@ jobs:
446452
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
447453
-name:Configure ccache action
448454
uses:hendrikmuhs/ccache-action@v1.2
455+
with:
456+
save:${{ github.event_name == 'push' }}
449457
-name:Configure CPython
450458
run:./configure --config-cache --with-address-sanitizer --without-pymalloc
451459
-name:Build CPython

‎.github/workflows/reusable-ubuntu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
4242
-name:Configure ccache action
4343
uses:hendrikmuhs/ccache-action@v1.2
44+
with:
45+
save:${{ github.event_name == 'push' }}
46+
max-size:"200M"
4447
-name:Setup directory envs for out-of-tree builds
4548
run:|
4649
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV

‎.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
-id:sphinx-lint
3030
args:[--enable=default-role]
31-
files:^Doc/|^Misc/NEWS.d/next/
31+
files:^Doc/|^Misc/NEWS.d/
3232

3333
-repo:meta
3434
hooks:

‎Doc/c-api/complex.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,29 @@ Complex Numbers as Python Objects
117117
118118
Return the real part of *op* as a C:c:expr:`double`.
119119
120+
If *op* is not a Python complex number object but has a
121+
:meth:`~object.__complex__` method, this method will first be called to
122+
convert *op* to a Python complex number object. If:meth:`!__complex__` is
123+
not defined then it falls back to call:c:func:`PyFloat_AsDouble` and
124+
returns its result. Upon failure, this method returns ``-1.0``, so one
125+
should call:c:func:`PyErr_Occurred` to check for errors.
126+
127+
..versionchanged::3.13
128+
Use:meth:`~object.__complex__` if available.
120129
121130
..c:function::doublePyComplex_ImagAsDouble(PyObject *op)
122131
123132
Return the imaginary part of *op* as a C:c:expr:`double`.
124133
134+
If *op* is not a Python complex number object but has a
135+
:meth:`~object.__complex__` method, this method will first be called to
136+
convert *op* to a Python complex number object. If:meth:`!__complex__` is
137+
not defined then it falls back to call:c:func:`PyFloat_AsDouble` and
138+
returns ``0.0`` on success. Upon failure, this method returns ``-1.0``, so
139+
one should call:c:func:`PyErr_Occurred` to check for errors.
140+
141+
..versionchanged::3.13
142+
Use:meth:`~object.__complex__` if available.
125143
126144
..c:function:: Py_complexPyComplex_AsCComplex(PyObject *op)
127145

‎Doc/c-api/object.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ Object Protocol
4747
4848
..c:function::intPyObject_HasAttr(PyObject *o, PyObject *attr_name)
4949
50-
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This
51-
is equivalent to the Python expression ``hasattr(o, attr_name)``. This function
52-
always succeeds.
50+
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
51+
This function always succeeds.
5352
5453
..note::
5554

‎Doc/faq/design.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ on the key and a per-process seed; for example, ``'Python'`` could hash to
451451
to ``1142331976``. The hash code is then used to calculate a location in an
452452
internal array where the value will be stored. Assuming that you're storing
453453
keys that all have different hash values, this means that dictionaries take
454-
constant time --O(1), in Big-O notation -- to retrieve a key.
454+
constant time --*O*\(1), in Big-O notation -- to retrieve a key.
455455

456456

457457
Why must dictionary keys be immutable?

‎Doc/glossary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ Glossary
742742
list
743743
A built-in Python:term:`sequence`. Despite its name it is more akin
744744
to an array in other languages than to a linked list since access to
745-
elements isO(1).
745+
elements is*O*\(1).
746746

747747
list comprehension
748748
A compact way to process all or part of the elements in a sequence and

‎Doc/howto/descriptor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ instance::
12501250
<function D.f at 0x00C45070>
12511251

12521252
>>> d.f.__self__
1253-
<__main__.D object at0x1012e1f98>
1253+
<__main__.D object at0x00B18C90>
12541254

12551255
If you have ever wondered where *self* comes from in regular methods or where
12561256
*cls* comes from in class methods, this is it!

‎Doc/howto/urllib2.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,16 +392,16 @@ info and geturl
392392
===============
393393

394394
The response returned by urlopen (or the:exc:`~urllib.error.HTTPError` instance) has two
395-
useful methods:meth:`info` and:meth:`geturl` and is defined in the module
396-
:mod:`urllib.response`..
395+
useful methods:meth:`!info` and:meth:`!geturl` and is defined in the module
396+
:mod:`urllib.response`.
397397

398-
**geturl** - this returns the real URL of the page fetched. This is useful
399-
because ``urlopen`` (or the opener object used) may have followed a
400-
redirect. The URL of the page fetched may not be the same as the URL requested.
398+
* **geturl** - this returns the real URL of the page fetched. This is useful
399+
because ``urlopen`` (or the opener object used) may have followed a
400+
redirect. The URL of the page fetched may not be the same as the URL requested.
401401

402-
**info** - this returns a dictionary-like object that describes the page
403-
fetched, particularly the headers sent by the server. It is currently an
404-
:class:`http.client.HTTPMessage` instance.
402+
* **info** - this returns a dictionary-like object that describes the page
403+
fetched, particularly the headers sent by the server. It is currently an
404+
:class:`http.client.HTTPMessage` instance.
405405

406406
Typical headers include 'Content-length', 'Content-type', and so on. See the
407407
`Quick Reference to HTTP Headers<https://jkorpela.fi/http.html>`_
@@ -507,7 +507,7 @@ than the URL you pass to .add_password() will also match. ::
507507

508508
In the above example we only supplied our ``HTTPBasicAuthHandler`` to
509509
``build_opener``. By default openers have the handlers for normal situations
510-
-- ``ProxyHandler`` (if a proxy setting such as an:envvar:`http_proxy`
510+
-- ``ProxyHandler`` (if a proxy setting such as an:envvar:`!http_proxy`
511511
environment variable is set), ``UnknownHandler``, ``HTTPHandler``,
512512
``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``,
513513
``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``.

‎Doc/library/asyncio-policy.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ implementation used by the asyncio event loop:
237237

238238
It works reliably even when the asyncio event loop is run in a non-main OS thread.
239239

240-
There is no noticeable overhead when handling a big number of children (*O(1)* each
240+
There is no noticeable overhead when handling a big number of children (*O*\(1) each
241241
time a child terminates), but starting a thread per process requires extra memory.
242242

243243
This watcher is used by default.
@@ -257,7 +257,7 @@ implementation used by the asyncio event loop:
257257
watcher is installed.
258258

259259
The solution is safe but it has a significant overhead when
260-
handling a big number of processes (*O(n)* each time a
260+
handling a big number of processes (*O*\(*n*) each time a
261261
:py:data:`SIGCHLD` is received).
262262

263263
..versionadded::3.8
@@ -273,7 +273,7 @@ implementation used by the asyncio event loop:
273273
The watcher avoids disrupting other code spawning processes
274274
by polling every process explicitly on a:py:data:`SIGCHLD` signal.
275275

276-
This solution is as safe as:class:`MultiLoopChildWatcher` and has the same *O(N)*
276+
This solution is as safe as:class:`MultiLoopChildWatcher` and has the same *O*\(*n*)
277277
complexity but requires a running event loop in the main thread to work.
278278

279279
..deprecated::3.12
@@ -285,7 +285,7 @@ implementation used by the asyncio event loop:
285285
processes and waiting for their termination.
286286

287287
There is no noticeable overhead when handling a big number of
288-
children (*O(1)* each time a child terminates).
288+
children (*O*\(1) each time a child terminates).
289289

290290
This solution requires a running event loop in the main thread to work, as
291291
:class:`SafeChildWatcher`.

‎Doc/library/bisect.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The following functions are provided:
7979
To support inserting records in a table, the *key* function (if any) is
8080
applied to *x* for the search step but not for the insertion step.
8181

82-
Keep in mind that the``O(logn)`` search is dominated by the slowO(n)
82+
Keep in mind that the*O*\(log*n*) search is dominated by the slow*O*\(*n*)
8383
insertion step.
8484

8585
..versionchanged::3.10
@@ -99,7 +99,7 @@ The following functions are provided:
9999
To support inserting records in a table, the *key* function (if any) is
100100
applied to *x* for the search step but not for the insertion step.
101101

102-
Keep in mind that the``O(logn)`` search is dominated by the slowO(n)
102+
Keep in mind that the*O*\(log*n*) search is dominated by the slow*O*\(*n*)
103103
insertion step.
104104

105105
..versionchanged::3.10
@@ -115,7 +115,7 @@ thoughts in mind:
115115
* Bisection is effective for searching ranges of values.
116116
For locating specific values, dictionaries are more performant.
117117

118-
* The *insort()* functions are``O(n)`` because the logarithmic search step
118+
* The *insort()* functions are*O*\(*n*) because the logarithmic search step
119119
is dominated by the linear time insertion step.
120120

121121
* The search functions are stateless and discard key function results after

‎Doc/library/collections.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,10 @@ or subtracting from an empty counter.
458458
Deques are a generalization of stacks and queues (the name is pronounced "deck"
459459
and is short for "double-ended queue"). Deques support thread-safe, memory
460460
efficient appends and pops from either side of the deque with approximately the
461-
sameO(1) performance in either direction.
461+
same*O*\(1) performance in either direction.
462462

463463
Though:class:`list` objects support similar operations, they are optimized for
464-
fast fixed-length operations and incurO(n) memory movement costs for
464+
fast fixed-length operations and incur*O*\(*n*) memory movement costs for
465465
``pop(0)`` and ``insert(0, v)`` operations which change both the size and
466466
position of the underlying data representation.
467467

@@ -585,7 +585,7 @@ or subtracting from an empty counter.
585585
In addition to the above, deques support iteration, pickling, ``len(d)``,
586586
``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with
587587
the:keyword:`in` operator, and subscript references such as ``d[0]`` to access
588-
the first element. Indexed access isO(1) at both ends but slows toO(n) in
588+
the first element. Indexed access is*O*\(1) at both ends but slows to*O*\(*n*) in
589589
the middle. For fast random access, use lists instead.
590590

591591
Starting in version 3.5, deques support ``__add__()``, ``__mul__()``,

‎Doc/library/contextvars.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Manual Context Management
131131
ctx: Context = copy_context()
132132
print(list(ctx.items()))
133133

134-
The function has anO(1) complexity, i.e. works equally fast for
134+
The function has an*O*\(1) complexity, i.e. works equally fast for
135135
contexts with a few context variables and for contexts that have
136136
a lot of them.
137137

‎Doc/library/functions.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,16 +668,15 @@ are always available. They are listed here in alphabetical order.
668668
sign: "+" | "-"
669669
infinity: "Infinity" | "inf"
670670
nan: "nan"
671-
digitpart: `!digit` (["_"] `!digit`)*
671+
digit: <a Unicode decimal digit, i.e. characters in Unicode general category Nd>
672+
digitpart: `digit` (["_"] `digit`)*
672673
number: [`digitpart`] "." `digitpart` | `digitpart` ["."]
673674
exponent: ("e" | "E") ["+" | "-"] `digitpart`
674675
floatnumber: number [`exponent`]
675676
floatvalue: [`sign`] (`floatnumber` | `infinity` | `nan`)
676677

677-
Here ``digit`` is a Unicode decimal digit (character in the Unicode general
678-
category ``Nd``). Case is not significant, so, for example, "inf", "Inf",
679-
"INFINITY", and "iNfINity" are all acceptable spellings for positive
680-
infinity.
678+
Case is not significant, so, for example, "inf", "Inf", "INFINITY", and
679+
"iNfINity" are all acceptable spellings for positive infinity.
681680

682681
Otherwise, if the argument is an integer or a floating point number, a
683682
floating point number with the same value (within Python's floating point

‎Doc/library/gc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The :mod:`gc` module provides the following functions:
9696
..versionadded::3.4
9797

9898

99-
..function::set_threshold(threshold0[, threshold1[,threshold2]])
99+
..function::set_threshold(threshold0, [threshold1, [threshold2]])
100100

101101
Set the garbage collection thresholds (the collection frequency). Setting
102102
*threshold0* to zero disables collection.

‎Doc/library/heapq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ winner. The simplest algorithmic way to remove it and find the "next" winner is
270270
to move some loser (let's say cell 30 in the diagram above) into the 0 position,
271271
and then percolate this new 0 down the tree, exchanging values, until the
272272
invariant is re-established. This is clearly logarithmic on the total number of
273-
items in the tree. By iterating over all items, you get anO(n logn) sort.
273+
items in the tree. By iterating over all items, you get an*O*\(*n* log*n*) sort.
274274

275275
A nice feature of this sort is that you can efficiently insert new items while
276276
the sort is going on, provided that the inserted items are not "better" than the

‎Doc/library/http.client.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The module provides the following classes:
9292
..versionchanged::3.4.3
9393
This class now performs all the necessary certificate and hostname checks
9494
by default. To revert to the previous, unverified, behavior
95-
:func:`ssl._create_unverified_context` can be passed to the *context*
95+
:func:`!ssl._create_unverified_context` can be passed to the *context*
9696
parameter.
9797

9898
..versionchanged::3.8
@@ -103,7 +103,7 @@ The module provides the following classes:
103103
..versionchanged::3.10
104104
This class now sends an ALPN extension with protocol indicator
105105
``http/1.1`` when no *context* is given. Custom *context* should set
106-
ALPN protocols with:meth:`~ssl.SSLContext.set_alpn_protocol`.
106+
ALPN protocols with:meth:`~ssl.SSLContext.set_alpn_protocols`.
107107

108108
..versionchanged::3.12
109109
The deprecated *key_file*, *cert_file* and *check_hostname* parameters
@@ -124,7 +124,7 @@ This module provides the following function:
124124
..function::parse_headers(fp)
125125

126126
Parse the headers from a file pointer *fp* representing a HTTP
127-
request/response. The file has to be a:class:`BufferedIOBase` reader
127+
request/response. The file has to be a:class:`~io.BufferedIOBase` reader
128128
(i.e. not text) and must provide a valid:rfc:`2822` style header.
129129

130130
This function returns an instance of:class:`http.client.HTTPMessage`
@@ -416,7 +416,7 @@ HTTPConnection Objects
416416
..versionadded::3.7
417417

418418

419-
As an alternative to using the:meth:`request` method described above, you can
419+
As an alternative to using the:meth:`~HTTPConnection.request` method described above, you can
420420
also send your request step by step, by using the four functions below.
421421

422422

@@ -648,6 +648,8 @@ method attribute. Here is an example session that uses the ``PUT`` method::
648648
HTTPMessage Objects
649649
-------------------
650650

651+
..class::HTTPMessage(email.message.Message)
652+
651653
An:class:`http.client.HTTPMessage` instance holds the headers from an HTTP
652654
response. It is implemented using the:class:`email.message.Message` class.
653655

‎Doc/library/itertools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ The following recipes have a more mathematical flavor:
11501150
# https://mathworld.wolfram.com/TotientFunction.html
11511151
# totient(12) --> 4 because len([1, 5, 7, 11]) == 4
11521152
for p in unique_justseen(factor(n)):
1153-
n = n // p * (p - 1)
1153+
n-= n // p
11541154
return n
11551155

11561156

‎Doc/library/kde_example.png

-16.7 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp