Skip to content

Commit 4c20ae6

Browse files
committed
Merge branch 'main' into co-branch-async-for
2 parents 2899103 + 885c3d1 commit 4c20ae6

Some content is hidden

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

62 files changed

+1531
-977
lines changed

Doc/c-api/intro.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ familiar with writing an extension before attempting to embed Python in a real
3030
application.
3131

3232

33+
Language version compatibility
34+
==============================
35+
36+
Python's C API is compatible with C11 and C++11 versions of C and C++.
37+
38+
This is a lower limit: the C API does not require features from later
39+
C/C++ versions.
40+
You do *not* need to enable your compiler's "c11 mode".
41+
42+
3343
Coding standards
3444
================
3545

Doc/library/concurrent.futures.rst

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -415,30 +415,6 @@ 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-
442418
.. _processpoolexecutor-example:
443419

444420
ProcessPoolExecutor Example

Doc/library/pdb.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ access further features, you have to do this yourself:
245245
.. versionadded:: 3.14
246246
Added the *mode* argument.
247247

248+
.. versionchanged:: 3.14
249+
Inline breakpoints like :func:`breakpoint` or :func:`pdb.set_trace` will
250+
always stop the program at calling frame, ignoring the *skip* pattern (if any).
251+
248252
.. method:: run(statement, globals=None, locals=None)
249253
runeval(expression, globals=None, locals=None)
250254
runcall(function, *args, **kwds)

Doc/library/typing.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2551,15 +2551,20 @@ types.
25512551

25522552
This functional syntax allows defining keys which are not valid
25532553
:ref:`identifiers <identifiers>`, for example because they are
2554-
keywords or contain hyphens::
2554+
keywords or contain hyphens, or when key names must not be
2555+
:ref:`mangled <private-name-mangling>` like regular private names::
25552556

25562557
# raises SyntaxError
25572558
class Point2D(TypedDict):
25582559
in: int # 'in' is a keyword
25592560
x-y: int # name with hyphens
25602561

2562+
class Definition(TypedDict):
2563+
__schema: str # mangled to `_Definition__schema`
2564+
25612565
# OK, functional syntax
25622566
Point2D = TypedDict('Point2D', {'in': int, 'x-y': int})
2567+
Definition = TypedDict('Definition', {'__schema': str}) # not mangled
25632568

25642569
By default, all keys must be present in a ``TypedDict``. It is possible to
25652570
mark individual keys as non-required using :data:`NotRequired`::

Doc/library/uuid.rst

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
--------------
1212

1313
This module provides immutable :class:`UUID` objects (the :class:`UUID` class)
14-
and the functions :func:`uuid1`, :func:`uuid3`, :func:`uuid4`, :func:`uuid5`,
15-
:func:`uuid6`, and :func:`uuid8` for generating version 1, 3, 4, 5, 6,
16-
and 8 UUIDs as specified in :rfc:`9562` (which supersedes :rfc:`4122`).
14+
and :ref:`functions <uuid-factory-functions>` for generating UUIDs corresponding
15+
to a specific UUID version as specified in :rfc:`9562` (which supersedes :rfc:`4122`),
16+
for example, :func:`uuid1` for UUID version 1, :func:`uuid3` for UUID version 3, and so on.
17+
Note that UUID version 2 is deliberately omitted as it is outside the scope of the RFC.
1718

1819
If all you want is a unique ID, you should probably call :func:`uuid1` or
1920
:func:`uuid4`. Note that :func:`uuid1` may compromise privacy since it creates
@@ -154,7 +155,7 @@ which relays any information about the UUID's safety, using this enumeration:
154155
:const:`RFC_4122`).
155156

156157
.. versionchanged:: next
157-
Added UUID versions 6 and 8.
158+
Added UUID versions 6, 7 and 8.
158159

159160

160161
.. attribute:: UUID.is_safe
@@ -185,6 +186,8 @@ The :mod:`uuid` module defines the following functions:
185186
globally unique, while the latter are not.
186187

187188

189+
.. _uuid-factory-functions:
190+
188191
.. function:: uuid1(node=None, clock_seq=None)
189192

190193
Generate a UUID from a host ID, sequence number, and the current time. If *node*
@@ -228,6 +231,18 @@ The :mod:`uuid` module defines the following functions:
228231
.. versionadded:: next
229232

230233

234+
.. function:: uuid7()
235+
236+
Generate a time-based UUID according to
237+
:rfc:`RFC 9562, §5.7 <9562#section-5.7>`.
238+
239+
For portability across platforms lacking sub-millisecond precision, UUIDs
240+
produced by this function embed a 48-bit timestamp and use a 42-bit counter
241+
to guarantee monotonicity within a millisecond.
242+
243+
.. versionadded:: next
244+
245+
231246
.. function:: uuid8(a=None, b=None, c=None)
232247

233248
Generate a pseudo-random UUID according to
@@ -330,7 +345,7 @@ The :mod:`uuid` module can be executed as a script from the command line.
330345

331346
.. code-block:: sh
332347
333-
python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid6,uuid8}] [-n NAMESPACE] [-N NAME]
348+
python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5,uuid6,uuid7,uuid8}] [-n NAMESPACE] [-N NAME]
334349
335350
The following options are accepted:
336351

@@ -347,7 +362,7 @@ The following options are accepted:
347362
is used.
348363

349364
.. versionchanged:: next
350-
Allow generating UUID versions 6 and 8.
365+
Allow generating UUID versions 6, 7 and 8.
351366

352367
.. option:: -n <namespace>
353368
--namespace <namespace>

Doc/whatsnew/3.14.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,6 @@ 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-
452447

453448
ctypes
454449
------
@@ -785,6 +780,11 @@ pdb
785780
the quit and call :func:`sys.exit`, instead of raising :exc:`bdb.BdbQuit`.
786781
(Contributed by Tian Gao in :gh:`124704`.)
787782

783+
* Inline breakpoints like :func:`breakpoint` or :func:`pdb.set_trace` will
784+
always stop the program at calling frame, ignoring the ``skip`` pattern
785+
(if any).
786+
(Contributed by Tian Gao in :gh:`130493`.)
787+
788788

789789
pickle
790790
------
@@ -924,8 +924,9 @@ urllib
924924
uuid
925925
----
926926

927-
* Add support for UUID versions 6 and 8 via :func:`uuid.uuid6` and
928-
:func:`uuid.uuid8` respectively, as specified in :rfc:`9562`.
927+
* Add support for UUID versions 6, 7, and 8 via :func:`uuid.uuid6`,
928+
:func:`uuid.uuid7`, and :func:`uuid.uuid8` respectively, as specified
929+
in :rfc:`9562`.
929930
(Contributed by Bénédikt Tran in :gh:`89083`.)
930931

931932
* :const:`uuid.NIL` and :const:`uuid.MAX` are now available to represent the

Include/cpython/unicodeobject.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,22 +212,21 @@ static inline unsigned int PyUnicode_IS_READY(PyObject* Py_UNUSED(op)) {
212212
#define PyUnicode_IS_READY(op) PyUnicode_IS_READY(_PyObject_CAST(op))
213213

214214
/* Return true if the string contains only ASCII characters, or 0 if not. The
215-
string may be compact (PyUnicode_IS_COMPACT_ASCII) or not, but must be
216-
ready. */
215+
string may be compact (PyUnicode_IS_COMPACT_ASCII) or not. */
217216
static inline unsigned int PyUnicode_IS_ASCII(PyObject *op) {
218217
return _PyASCIIObject_CAST(op)->state.ascii;
219218
}
220219
#define PyUnicode_IS_ASCII(op) PyUnicode_IS_ASCII(_PyObject_CAST(op))
221220

222221
/* Return true if the string is compact or 0 if not.
223-
No type checks or Ready calls are performed. */
222+
No type checks are performed. */
224223
static inline unsigned int PyUnicode_IS_COMPACT(PyObject *op) {
225224
return _PyASCIIObject_CAST(op)->state.compact;
226225
}
227226
#define PyUnicode_IS_COMPACT(op) PyUnicode_IS_COMPACT(_PyObject_CAST(op))
228227

229228
/* Return true if the string is a compact ASCII string (use PyASCIIObject
230-
structure), or 0 if not. No type checks or Ready calls are performed. */
229+
structure), or 0 if not. No type checks are performed. */
231230
static inline int PyUnicode_IS_COMPACT_ASCII(PyObject *op) {
232231
return (_PyASCIIObject_CAST(op)->state.ascii && PyUnicode_IS_COMPACT(op));
233232
}
@@ -319,7 +318,7 @@ static inline void PyUnicode_WRITE(int kind, void *data,
319318
(index), _Py_STATIC_CAST(Py_UCS4, value))
320319

321320
/* Read a code point from the string's canonical representation. No checks
322-
or ready calls are performed. */
321+
are performed. */
323322
static inline Py_UCS4 PyUnicode_READ(int kind,
324323
const void *data, Py_ssize_t index)
325324
{

Include/internal/pycore_traceback.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ extern const char* _Py_DumpTracebackThreads(
6666
/* Write a Unicode object into the file descriptor fd. Encode the string to
6767
ASCII using the backslashreplace error handler.
6868
69-
Do nothing if text is not a Unicode object. The function accepts Unicode
70-
string which is not ready (PyUnicode_WCHAR_KIND).
69+
Do nothing if text is not a Unicode object.
7170
7271
This function is signal safe. */
7372
extern void _Py_DumpASCII(int fd, PyObject *text);

Include/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */
683683
typedef enum {
684684
PYGEN_RETURN = 0,
685685
PYGEN_ERROR = -1,
686-
PYGEN_NEXT = 1,
686+
PYGEN_NEXT = 1
687687
} PySendResult;
688688
#endif
689689

Lib/bdb.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,13 @@ def dispatch_opcode(self, frame, arg):
215215
If the debugger stops on the current opcode, invoke
216216
self.user_opcode(). Raise BdbQuit if self.quitting is set.
217217
Return self.trace_dispatch to continue tracing in this scope.
218+
219+
Opcode event will always trigger the user callback. For now the only
220+
opcode event is from an inline set_trace() and we want to stop there
221+
unconditionally.
218222
"""
219-
if self.stop_here(frame) or self.break_here(frame):
220-
self.user_opcode(frame)
221-
if self.quitting: raise BdbQuit
223+
self.user_opcode(frame)
224+
if self.quitting: raise BdbQuit
222225
return self.trace_dispatch
223226

224227
# Normally derived classes don't override the following

0 commit comments

Comments
 (0)