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

Commit2b31bb0

Browse files
Merge branch 'main' into fix/129846
2 parents1d8e23f +d0eb01c commit2b31bb0

File tree

40 files changed

+2105
-1262
lines changed

40 files changed

+2105
-1262
lines changed

‎Doc/c-api/structures.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ under :ref:`reference counting <countingrefs>`.
6363
See documentation of:c:type:`PyVarObject` above.
6464

6565

66+
..c:var:: PyTypeObject PyBaseObject_Type
67+
68+
The base class of all other objects, the same as:class:`object` in Python.
69+
70+
6671
..c:function::intPy_Is(PyObject *x, PyObject *y)
6772
6873
Test if the *x* object is the *y* object, the same as ``x is y`` in Python.

‎Doc/library/collections.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
748748
returns or raises is then returned or raised by:meth:`~object.__getitem__`.
749749

750750
Note that:meth:`__missing__` is *not* called for any operations besides
751-
:meth:`~object.__getitem__`. This means that:meth:`get` will, like normal
752-
dictionaries, return ``None`` as a default rather than using
751+
:meth:`~object.__getitem__`. This means that:meth:`~dict.get` will, like
752+
normaldictionaries, return ``None`` as a default rather than using
753753
:attr:`default_factory`.
754754

755755

@@ -849,8 +849,9 @@ they add the ability to access fields by name instead of position index.
849849
Returns a new tuple subclass named *typename*. The new subclass is used to
850850
create tuple-like objects that have fields accessible by attribute lookup as
851851
well as being indexable and iterable. Instances of the subclass also have a
852-
helpful docstring (with typename and field_names) and a helpful:meth:`__repr__`
853-
method which lists the tuple contents in a ``name=value`` format.
852+
helpful docstring (with *typename* and *field_names*) and a helpful
853+
:meth:`~object.__repr__` method which lists the tuple contents in a ``name=value``
854+
format.
854855

855856
The *field_names* are a sequence of strings such as ``['x', 'y']``.
856857
Alternatively, *field_names* can be a single string with each fieldname
@@ -894,10 +895,10 @@ they add the ability to access fields by name instead of position index.
894895
Added the *module* parameter.
895896

896897
..versionchanged::3.7
897-
Removed the *verbose* parameter and the:attr:`_source` attribute.
898+
Removed the *verbose* parameter and the:attr:`!_source` attribute.
898899

899900
..versionchanged::3.7
900-
Added the *defaults* parameter and the:attr:`_field_defaults`
901+
Added the *defaults* parameter and the:attr:`~somenamedtuple._field_defaults`
901902
attribute.
902903

903904
..doctest::
@@ -1109,7 +1110,7 @@ Some differences from :class:`dict` still remain:
11091110
A regular:class:`dict` can emulate the order sensitive equality test with
11101111
``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``.
11111112

1112-
* The:meth:`popitem` method of:class:`OrderedDict` has a different
1113+
* The:meth:`~OrderedDict.popitem` method of:class:`OrderedDict` has a different
11131114
signature. It accepts an optional argument to specify which item is popped.
11141115

11151116
A regular:class:`dict` can emulate OrderedDict's ``od.popitem(last=True)``
@@ -1119,7 +1120,7 @@ Some differences from :class:`dict` still remain:
11191120
with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the
11201121
leftmost (first) item if it exists.
11211122

1122-
*:class:`OrderedDict` has a:meth:`move_to_end` method to efficiently
1123+
*:class:`OrderedDict` has a:meth:`~OrderedDict.move_to_end` method to efficiently
11231124
reposition an element to an endpoint.
11241125

11251126
A regular:class:`dict` can emulate OrderedDict's ``od.move_to_end(k,
@@ -1130,7 +1131,7 @@ Some differences from :class:`dict` still remain:
11301131
OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key
11311132
and its associated value to the leftmost (first) position.
11321133

1133-
* Until Python 3.8,:class:`dict` lacked a:meth:`__reversed__` method.
1134+
* Until Python 3.8,:class:`dict` lacked a:meth:`~object.__reversed__` method.
11341135

11351136

11361137
..class::OrderedDict([items])
@@ -1185,7 +1186,7 @@ anywhere a regular dictionary is used.
11851186

11861187
..versionchanged::3.6
11871188
With the acceptance of:pep:`468`, order is retained for keyword arguments
1188-
passed to the:class:`OrderedDict` constructor and its:meth:`update`
1189+
passed to the:class:`OrderedDict` constructor and its:meth:`~dict.update`
11891190
method.
11901191

11911192
..versionchanged::3.9

‎Doc/library/concurrent.futures.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,30 @@ to a :class:`ProcessPoolExecutor` will result in deadlock.
415415
require the *fork* start method for:class:`ProcessPoolExecutor` you must
416416
explicitly pass ``mp_context=multiprocessing.get_context("fork")``.
417417

418+
..method::terminate_workers()
419+
420+
Attempt to terminate all living worker processes immediately by calling
421+
:meth:`Process.terminate <multiprocessing.Process.terminate>` on each of them.
422+
Internally, it will also call:meth:`Executor.shutdown` to ensure that all
423+
other resources associated with the executor are freed.
424+
425+
After calling this method the caller should no longer submit tasks to the
426+
executor.
427+
428+
..versionadded::next
429+
430+
..method::kill_workers()
431+
432+
Attempt to kill all living worker processes immediately by calling
433+
:meth:`Process.kill <multiprocessing.Process.kill>` on each of them.
434+
Internally, it will also call:meth:`Executor.shutdown` to ensure that all
435+
other resources associated with the executor are freed.
436+
437+
After calling this method the caller should no longer submit tasks to the
438+
executor.
439+
440+
..versionadded::next
441+
418442
.. _processpoolexecutor-example:
419443

420444
ProcessPoolExecutor Example

‎Doc/library/constants.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ A small number of constants live in the built-in namespace. They are:
4646

4747
See:ref:`implementing-the-arithmetic-operations` for examples.
4848

49-
..note::
49+
..caution::
5050

51-
``NotImplementedError`` and:data:`!NotImplemented` are not interchangeable,
52-
even though they have similar names and purposes.
53-
See:exc:`NotImplementedError` for details on when to use it.
51+
:data:`!NotImplemented` and:exc:`!NotImplementedError` are not
52+
interchangeable. This constant should only be used as described
53+
above; see:exc:`NotImplementedError` for details on correct usage
54+
of the exception.
5455

5556
..versionchanged::3.9
5657
Evaluating:data:`!NotImplemented` in a boolean context was deprecated.

‎Doc/library/email.errors.rst

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -77,51 +77,72 @@ object would have a defect, but the containing messages would not.
7777

7878
All defect classes are subclassed from:class:`email.errors.MessageDefect`.
7979

80-
*:class:`NoBoundaryInMultipartDefect` -- A message claimed to be a multipart,
81-
but had no:mimetype:`boundary` parameter.
80+
..exception::NoBoundaryInMultipartDefect
8281

83-
*:class:`StartBoundaryNotFoundDefect` -- The start boundaryclaimedin the
84-
:mailheader:`Content-Type` header was never found.
82+
A messageclaimedto be a multipart, but had no:mimetype:`boundary`
83+
parameter.
8584

86-
*:class:`CloseBoundaryNotFoundDefect` -- A start boundary was found, but
87-
no corresponding close boundary was ever found.
85+
..exception::StartBoundaryNotFoundDefect
8886

89-
..versionadded::3.3
87+
The start boundary claimed in the:mailheader:`Content-Type` header was
88+
never found.
9089

91-
*:class:`FirstHeaderLineIsContinuationDefect` -- The message had a continuation
92-
line as its first header line.
90+
..exception::CloseBoundaryNotFoundDefect
9391

94-
*:class:`MisplacedEnvelopeHeaderDefect` - A"Unix From" headerwas found in the
95-
middle of a header block.
92+
Astart boundarywas found, but no corresponding close boundary was ever
93+
found.
9694

97-
*:class:`MissingHeaderBodySeparatorDefect` - A line was found while parsing
98-
headers that had no leading white space but contained no ':'. Parsing
99-
continues assuming that the line represents the first line of the body.
95+
..versionadded::3.3
10096

101-
..versionadded::3.3
97+
..exception::FirstHeaderLineIsContinuationDefect
10298

103-
*:class:`MalformedHeaderDefect` -- A header was found that was missing a colon,
104-
or was otherwise malformed.
99+
The message had a continuation line as its first header line.
105100

106-
..deprecated::3.3
107-
This defect has not been used for several Python versions.
101+
..exception::MisplacedEnvelopeHeaderDefect
108102

109-
*:class:`MultipartInvariantViolationDefect` -- A message claimed to be a
110-
:mimetype:`multipart`, but no subparts were found. Note that when a message
111-
has this defect, its:meth:`~email.message.Message.is_multipart` method may
112-
return ``False`` even though its content type claims to be:mimetype:`multipart`.
103+
A "Unix From" header was found in the middle of a header block.
113104

114-
*:class:`InvalidBase64PaddingDefect` -- When decoding a block of base64
115-
encoded bytes, the padding was not correct. Enough padding is added to
116-
perform the decode, but the resulting decoded bytes may be invalid.
105+
..exception::MissingHeaderBodySeparatorDefect
117106

118-
*:class:`InvalidBase64CharactersDefect` -- When decoding a block of base64
119-
encoded bytes, characters outside the base64 alphabet were encountered.
120-
The characters are ignored, buttheresulting decoded bytes may be invalid.
107+
A line was found while parsing headers that had no leading white space but
108+
contained no ':'. Parsing continues assuming that the line represents the
109+
first line ofthebody.
121110

122-
*:class:`InvalidBase64LengthDefect` -- When decoding a block of base64 encoded
123-
bytes, the number of non-padding base64 characters was invalid (1 more than
124-
a multiple of 4). The encoded block was kept as-is.
111+
..versionadded::3.3
125112

126-
*:class:`InvalidDateDefect` -- When decoding an invalid or unparsable date field.
127-
The original value is kept as-is.
113+
..exception::MalformedHeaderDefect
114+
115+
A header was found that was missing a colon, or was otherwise malformed.
116+
117+
..deprecated::3.3
118+
This defect has not been used for several Python versions.
119+
120+
..exception::MultipartInvariantViolationDefect
121+
122+
A message claimed to be a:mimetype:`multipart`, but no subparts were found.
123+
Note that when a message has this defect, its
124+
:meth:`~email.message.Message.is_multipart` method may return ``False``
125+
even though its content type claims to be:mimetype:`multipart`.
126+
127+
..exception::InvalidBase64PaddingDefect
128+
129+
When decoding a block of base64 encoded bytes, the padding was not correct.
130+
Enough padding is added to perform the decode, but the resulting decoded
131+
bytes may be invalid.
132+
133+
..exception::InvalidBase64CharactersDefect
134+
135+
When decoding a block of base64 encoded bytes, characters outside the base64
136+
alphabet were encountered. The characters are ignored, but the resulting
137+
decoded bytes may be invalid.
138+
139+
..exception::InvalidBase64LengthDefect
140+
141+
When decoding a block of base64 encoded bytes, the number of non-padding
142+
base64 characters was invalid (1 more than a multiple of 4). The encoded
143+
block was kept as-is.
144+
145+
..exception::InvalidDateDefect
146+
147+
When decoding an invalid or unparsable date field. The original value is
148+
kept as-is.

‎Doc/library/exceptions.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,13 @@ The following exceptions are the exceptions that are usually raised.
333333
meant to be supported at all -- in that case either leave the operator /
334334
method undefined or, if a subclass, set it to:data:`None`.
335335

336-
..note::
336+
..caution::
337+
338+
:exc:`!NotImplementedError` and:data:`!NotImplemented` are not
339+
interchangeable. This exception should only be used as described
340+
above; see:data:`NotImplemented` for details on correct usage of
341+
the built-in constant.
337342

338-
``NotImplementedError`` and:data:`NotImplemented` are not interchangeable,
339-
even though they have similar names and purposes. See
340-
:data:`!NotImplemented` for details on when to use it.
341343

342344
..exception::OSError([arg])
343345
OSError(errno, strerror[, filename[, winerror[, filename2]]])

‎Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ Doc/extending/extending.rst
1515
Doc/library/ast.rst
1616
Doc/library/asyncio-extending.rst
1717
Doc/library/asyncio-subprocess.rst
18-
Doc/library/collections.rst
1918
Doc/library/decimal.rst
2019
Doc/library/email.charset.rst
2120
Doc/library/email.compat32-message.rst
22-
Doc/library/email.errors.rst
2321
Doc/library/email.parser.rst
2422
Doc/library/exceptions.rst
2523
Doc/library/functools.rst

‎Doc/whatsnew/3.14.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,11 @@ contextvars
444444
* Support context manager protocol by:class:`contextvars.Token`.
445445
(Contributed by Andrew Svetlov in:gh:`129889`.)
446446

447+
* Add:meth:`concurrent.futures.ProcessPoolExecutor.terminate_workers` and
448+
:meth:`concurrent.futures.ProcessPoolExecutor.kill_workers` as
449+
ways to terminate or kill all living worker processes in the given pool.
450+
(Contributed by Charles Machalow in:gh:`128043`.)
451+
447452

448453
ctypes
449454
------

‎Include/internal/pycore_code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ read_obj(uint16_t *p)
474474
returnval;
475475
}
476476

477-
/* SeeObjects/exception_handling_notes.txt for details.
477+
/* SeeInternalDocs/exception_handling.md for details.
478478
*/
479479
staticinlineunsignedchar*
480480
parse_varint(unsignedchar*p,int*result) {

‎Include/internal/pycore_optimizer.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ typedef enum _JitSymType {
172172
JIT_SYM_KNOWN_CLASS_TAG=6,
173173
JIT_SYM_KNOWN_VALUE_TAG=7,
174174
JIT_SYM_TUPLE_TAG=8,
175+
JIT_SYM_TRUTHINESS_TAG=9,
175176
}JitSymType;
176177

177178
typedefstruct_jit_opt_known_class {
@@ -198,12 +199,19 @@ typedef struct _jit_opt_tuple {
198199
uint16_titems[MAX_SYMBOLIC_TUPLE_SIZE];
199200
}JitOptTuple;
200201

202+
typedefstruct {
203+
uint8_ttag;
204+
boolnot;
205+
uint16_tvalue;
206+
}JitOptTruthiness;
207+
201208
typedefunion_jit_opt_symbol {
202209
uint8_ttag;
203210
JitOptKnownClasscls;
204211
JitOptKnownValuevalue;
205212
JitOptKnownVersionversion;
206213
JitOptTupletuple;
214+
JitOptTruthinesstruthiness;
207215
}JitOptSymbol;
208216

209217

@@ -245,8 +253,8 @@ typedef struct _JitOptContext {
245253

246254
externbool_Py_uop_sym_is_null(JitOptSymbol*sym);
247255
externbool_Py_uop_sym_is_not_null(JitOptSymbol*sym);
248-
externbool_Py_uop_sym_is_const(JitOptSymbol*sym);
249-
externPyObject*_Py_uop_sym_get_const(JitOptSymbol*sym);
256+
externbool_Py_uop_sym_is_const(JitOptContext*ctx,JitOptSymbol*sym);
257+
externPyObject*_Py_uop_sym_get_const(JitOptContext*ctx,JitOptSymbol*sym);
250258
externJitOptSymbol*_Py_uop_sym_new_unknown(JitOptContext*ctx);
251259
externJitOptSymbol*_Py_uop_sym_new_not_null(JitOptContext*ctx);
252260
externJitOptSymbol*_Py_uop_sym_new_type(
@@ -262,12 +270,13 @@ extern void _Py_uop_sym_set_type(JitOptContext *ctx, JitOptSymbol *sym, PyTypeOb
262270
externbool_Py_uop_sym_set_type_version(JitOptContext*ctx,JitOptSymbol*sym,unsignedintversion);
263271
externvoid_Py_uop_sym_set_const(JitOptContext*ctx,JitOptSymbol*sym,PyObject*const_val);
264272
externbool_Py_uop_sym_is_bottom(JitOptSymbol*sym);
265-
externint_Py_uop_sym_truthiness(JitOptSymbol*sym);
273+
externint_Py_uop_sym_truthiness(JitOptContext*ctx,JitOptSymbol*sym);
266274
externPyTypeObject*_Py_uop_sym_get_type(JitOptSymbol*sym);
267275
externbool_Py_uop_sym_is_immortal(JitOptSymbol*sym);
268276
externJitOptSymbol*_Py_uop_sym_new_tuple(JitOptContext*ctx,intsize,JitOptSymbol**args);
269277
externJitOptSymbol*_Py_uop_sym_tuple_getitem(JitOptContext*ctx,JitOptSymbol*sym,intitem);
270278
externint_Py_uop_sym_tuple_length(JitOptSymbol*sym);
279+
externJitOptSymbol*_Py_uop_sym_new_truthiness(JitOptContext*ctx,JitOptSymbol*value,booltruthy);
271280

272281
externvoid_Py_uop_abstractcontext_init(JitOptContext*ctx);
273282
externvoid_Py_uop_abstractcontext_fini(JitOptContext*ctx);

‎Lib/asyncio/tasks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,6 @@ def _unregister_eager_task(task):
11101110
from_asyncioimport (_register_task,_register_eager_task,
11111111
_unregister_task,_unregister_eager_task,
11121112
_enter_task,_leave_task,_swap_current_task,
1113-
_scheduled_tasks,_eager_tasks,
11141113
current_task,all_tasks)
11151114
exceptImportError:
11161115
pass

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp