8000 Merge branch 'main' into sqlite-cache · python/cpython@150b3e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 150b3e7

Browse files
author
Erlend E. Aasland
committed
Merge branch 'main' into sqlite-cache
2 parents 9882ebd + af5a324 commit 150b3e7

File tree

102 files changed

+5891
-5275
lines changed

Some content is hidden

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

102 files changed

+5891
-5275
lines changed

Doc/c-api/gcsupport.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ Constructors for container types must conform to two rules:
3333
#. Once all the fields which may contain references to other containers are
3434
initialized, it must call :c:func:`PyObject_GC_Track`.
3535

36+
.. warning::
37+
If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least
38+
a :c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one
39+
from its subclass or subclasses.
40+
41+
When calling :c:func:`PyType_Ready` or some of the APIs that indirectly
42+
call it like :c:func:`PyType_FromSpecWithBases` or
43+
:c:func:`PyType_FromSpec` the interpreter will automatically populate the
44+
:c:member:`~PyTypeObject.tp_flags`, :c:member:`~PyTypeObject.tp_traverse`
45+
and :c:member:`~PyTypeObject.tp_clear` fields if the type inherits from a
46+
class that implements the garbage collector protocol and the child class
47+
does *not* include the :const:`Py_TPFLAGS_HAVE_GC` flag.
3648

3749
.. c:function:: TYPE* PyObject_GC_New(TYPE, PyTypeObject *type)
3850

Doc/c-api/type.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ Type Objects
9797
from a type's base class. Return ``0`` on success, or return ``-1`` and sets an
9898
exception on error.
9999
100+
.. note::
101+
If some of the base classes implements the GC protocol and the provided
102+
type does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then
103+
the GC protocol will be automatically implemented from its parents. On
104+
the contrary, if the type being created does include
105+
:const:`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the
106+
GC protocol itself by at least implementing the
107+
:c:member:`~PyTypeObject.tp_traverse` handle.
108+
100109
.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
101110
102111
Return the function pointer stored in the given slot. If the

Doc/faq/gui.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ FLTK
9292

9393
Python bindings for `the FLTK toolkit <http://www.fltk.org>`_, a simple yet
9494
powerful and mature cross-platform windowing system, are available from `the
95-
PyFLTK project <http://pyfltk.sourceforge.net>`_.
95+
PyFLTK project <https://pyfltk.sourceforge.io/>`_.
9696

9797
OpenGL
9898
------

Doc/library/asyncio-queue.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ Queue
105105
Raises :exc:`ValueError` if called more times than there were
106106
items placed in the queue.
107107

108+
.. deprecated-removed:: 3.8 3.10
109+
110+
The ``loop`` parameter. This function has been implicitly getting the
111+
current running loop since 3.7. See
112+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
113+
for more information.
114+
108115

109116
Priority Queue
110117
==============

Doc/library/asyncio-stream.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ and work with streams:
7070

7171
The *ssl_handshake_timeout* parameter.
7272

73+
.. deprecated-removed:: 3.8 3.10
74+
75+
The ``loop`` parameter. This function has been implicitly getting the
76+
current running loop since 3.7. See
77+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
78+
for more information.
79+
80+
7381
.. coroutinefunction:: start_server(client_connected_cb, host=None, \
7482
port=None, *, limit=None, \
7583
family=socket.AF_UNSPEC, \
@@ -100,6 +108,13 @@ and work with streams:
100108

101109
The *ssl_handshake_timeout* and *start_serving* parameters.
102110

111+
.. deprecated-removed:: 3.8 3.10
112+
113+
The ``loop`` parameter. This function has been implicitly getting the
114+
current running loop since 3.7. See
115+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
116+
for more information.
117+
103118

104119
.. rubric:: Unix Sockets
105120

@@ -124,6 +139,13 @@ and work with streams:
124139

125140
The *path* parameter can now be a :term:`path-like object`
126141

142+
.. deprecated-removed:: 3.8 3.10
143+
144+
The ``loop`` parameter. This function has been implicitly getting the
145+
current running loop since 3.7. See
146+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
147+
for more information.
148+
127149

128150
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
129151
*, limit=None, sock=None, backlog=100, ssl=None, \
@@ -145,6 +167,13 @@ and work with streams:
145167

146168
The *path* parameter can now be a :term:`path-like object`.
147169

170+
.. deprecated-removed:: 3.8 3.10
171+
172+
The ``loop`` parameter. This function has been implicitly getting the
173+
current running loop since 3.7. See
174+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
175+
for more information.
176+
148177

149178
StreamReader
150179
============

Doc/library/asyncio-subprocess.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ Creating Subprocesses
7575
See the documentation of :meth:`loop.subprocess_exec` for other
7676
parameters.
7777

78+
.. deprecated-removed:: 3.8 3.10
79+
80+
The ``loop`` parameter. This function has been implicitly getting the
81+
current running loop since 3.7. See
82+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
83+
for more information.
84+
7885

7986
.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
8087
stdout=None, stderr=None, limit=None, **kwds)
@@ -99,6 +106,13 @@ Creating Subprocesses
99106
escape whitespace and special shell characters in strings that are going
100107
to be used to construct shell commands.
101108

109+
.. deprecated-removed:: 3.8 3.10
110+
111+
The ``loop`` parameter. This function has been implicitly getting the
112+
current running loop since 3.7. See
113+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
114+
for more information.
115+
102116
.. note::
103117

104118
Subprocesses are available for Windows if a :class:`ProactorEventLoop` is

Doc/library/asyncio-sync.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ Lock
6363
finally:
6464
lock.release()
6565

66+
.. deprecated-removed:: 3.8 3.10
67+
The ``loop`` parameter. This class has been implicitly getting the
68+
current running loop since 3.7. See
69+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
70+
for more information.
71+
6672
.. coroutinemethod:: acquire()
6773

6874
Acquire the lock.
@@ -105,6 +111,12 @@ Event
105111
:meth:`clear` method. The :meth:`~Event.wait` method blocks until the
106112
flag is set to *true*. The flag is set to *false* initially.
107113

114+
.. deprecated-removed:: 3.8 3.10
115+
The ``loop`` parameter. This class has been implicitly getting the
116+
current running loop since 3.7. See
117+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
118+
for more information.
119+
108120
.. _asyncio_example_sync_event:
109121

110122
Example::
@@ -177,6 +189,12 @@ Condition
177189
``None``. In the latter case a new Lock object is created
178190
automatically.
179191

192+
.. deprecated-removed:: 3.8 3.10
193+
The ``loop`` parameter. This class has been implicitly getting the
194+
current running loop since 3.7. See
195+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
196+
for more information.
197+
180198
The preferred way to use a Condition is an :keyword:`async with`
181199
statement::
182200

@@ -273,6 +291,12 @@ Semaphore
273291
internal counter (``1`` by default). If the given value is
274292
less than ``0`` a :exc:`ValueError` is raised.
275293

294+
.. deprecated-removed:: 3.8 3.10
295+
The ``loop`` parameter. This class has been implicitly getting the
296+
current running loop since 3.7. See
297+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
298+
for more information.
299+
276300
The preferred way to use a Semaphore is an :keyword:`async with`
277301
statement::
278302

@@ -325,6 +349,13 @@ BoundedSemaphore
325349
a :exc:`ValueError` in :meth:`~Semaphore.release` if it
326350
increases the internal counter above the initial *value*.
327351

352+
.. deprecated-removed:: 3.8 3.10
353+
354+
The ``loop`` parameter. This class has been implicitly getting the
355+
current running loop since 3.7. See
356+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
357+
for more information.
358+
328359
---------
329360

330361

Doc/library/asyncio-task.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ Sleeping
297297
tasks to run. This can be used by long-running functions to avoid
298298
blocking the event loop for the full duration of the function call.
299299

300+
.. deprecated-removed:: 3.8 3.10
301+
The ``loop`` parameter. This function has been implicitly getting the
302+
current running loop since 3.7. See
303+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
304+
for more information.
305+
300306
.. _asyncio_example_sleep:
301307

302308
Example of coroutine displaying the current date every second
@@ -317,6 +323,14 @@ Sleeping
317323
asyncio.run(display_date())
318324

319325

326+
.. deprecated-removed:: 3.8 3.10
327+
328+
The ``loop`` parameter. This function has been implicitly getting the
329+
current running loop since 3.7. See
330+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
331+
for more information.
332+
333+
320334
Running Tasks Concurrently
321335
==========================
322336

@@ -349,6 +363,12 @@ Running Tasks Concurrently
349363
cancellation of one submitted Task/Future to cause other
350364
Tasks/Futures to be cancelled.
351365

366+
.. deprecated-removed:: 3.8 3.10
367+
The ``loop`` parameter. This function has been implicitly getting the
368+
current running loop since 3.7. See
369+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
370+
for more information.
371+
352372
.. _asyncio_example_gather:
353373

354374
Example::
@@ -400,6 +420,12 @@ Running Tasks Concurrently
400420
If the *gather* itself is cancelled, the cancellation is
401421
propagated regardless of *return_exceptions*.
402422

423+
.. deprecated-removed:: 3.8 3.10
424+
The ``loop`` parameter. This function has been implicitly getting the
425+
current running loop since 3.7. See
426+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
427+
for more information.
428+
403429
.. deprecated:: 3.10
404430
Deprecation warning is emitted if no positional arguments are provided
405431
or not all positional arguments are Future-like objects
@@ -442,6 +468,12 @@ Shielding From Cancellation
442468
except CancelledError:
443469
res = None
444470

471+
.. deprecated-removed:: 3.8 3.10
472+
The ``loop`` parameter. This function has been implicitly getting the
473+
current running loop since 3.7. See
474+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
475+
for more information.
476+
445477
.. deprecated:: 3.10
446478
Deprecation warning is emitted if *aw* is not Future-like object
447479
and there is no running event loop.
@@ -473,6 +505,12 @@ Timeouts
473505

474506
If the wait is cancelled, the future *aw* is also cancelled.
475507

508+
.. deprecated-removed:: 3.8 3.10
509+
The ``loop`` parameter. This function has been implicitly getting the
510+
current running loop since 3.7. See
511+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
512+
for more information.
513+
476514
.. _asyncio_example_waitfor:
477515

478516
Example::
@@ -500,6 +538,12 @@ Timeouts
500538
for *aw* to be cancelled. Previously, it raised
501539
:exc:`asyncio.TimeoutError` immediately.
502540

541+
.. deprecated-removed:: 3.8 3.10
542+
The ``loop`` parameter. This function has been implicitly getting the
543+
current running loop since 3.7. See
544+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
545+
for more information.
546+
503547

504548
Waiting Primitives
505549
==================
@@ -556,6 +600,12 @@ Waiting Primitives
556600
``wait()`` directly is deprecated as it leads to
557601
:ref:`confusing behavior <asyncio_example_wait_coroutine>`.
558602

603+
.. deprecated-removed:: 3.8 3.10
604+
The ``loop`` parameter. This function has been implicitly getting the
605+
current running loop since 3.7. See
606+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
607+
for more information.
608+
559609
.. _asyncio_example_wait_coroutine:
560610
.. note::
561611

@@ -583,6 +633,13 @@ Waiting Primitives
583633
if task in done:
584634
# Everything will work as expected now.
585635

636+
.. deprecated-removed:: 3.8 3.10
637+
638+
The ``loop`` parameter. This function has been implicitly getting the
639+
current running loop since 3.7. See
640+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
641+
for more information.
642+
586643
.. deprecated-removed:: 3.8 3.11
587644

588645
Passing coroutine objects to ``wait()`` directly is
@@ -599,12 +656,24 @@ Waiting Primitives
599656
Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
600657
all Futures are done.
601658

659+
.. deprecated-removed:: 3.8 3.10
660+
The ``loop`` parameter. This function has been implicitly getting the
661+
current running loop since 3.7. See
662+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
663+
for more information.
664+
602665
Example::
603666

604667
for coro in as_completed(aws):
605668
earliest_result = await coro
606669
# ...
607670

671+
.. deprecated-removed:: 3.8 3.10
672+
The ``loop`` parameter. This function has been implicitly getting the
673+
current running loop since 3.7. See
674+
:ref:`What's New in 3.10's Removed section <whatsnew310-removed>`
675+
for more information.
676+
608677
.. deprecated:: 3.10
609678
Deprecation warning is emitted if not all awaitable objects in the *aws*
610679
iterable are Future-like objects and there is no running event loop.

Doc/library/builtins.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ that wants to implement an :func:`open` function that wraps the built-in
2525
return UpperCaser(f)
2626

2727
class UpperCaser:
28-
'''Wrapper around a file that converts output to upper-case.'''
28+
'''Wrapper around a file that converts output to uppercase.'''
2929

3030
def __init__(self, f):
3131
self._f = f

Doc/library/contextlib.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,11 @@ Functions and classes provided:
312312

313313
For example, the output of :func:`help` normally is sent to *sys.stdout*.
314314
You can capture that output in a string by redirecting the output to an
315-
:class:`io.StringIO` object::
315+
:class:`io.StringIO` object. The replacement stream is returned from the
316+
``__enter__`` method and so is available as the target of the
317+
:keyword:`with` statement::
316318

317-
f = io.StringIO()
318-
with redirect_stdout(f):
319+
with redirect_stdout(io.StringIO()) as f:
319320
help(pow)
320321
s = f.getvalue()
321322

Doc/library/msilib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ structures.
119119
.. function:: gen_uuid()
120120

121121
Return a new UUID, in the format that MSI typically requires (i.e. in curly
122-
braces, and with all hexdigits in upper-case).
122+
braces, and with all hexdigits in uppercase).
123123

124124

125125
.. seealso::

Doc/library/poplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ One exception is defined as an attribute of the :mod:`poplib` module:
118118
POP3 Objects
119119
------------
120120

121-
All POP3 commands are represented by methods of the same name, in lower-case;
121+
All POP3 commands are represented by methods of the same name, in lowercase;
122122
most return the response text sent by the server.
123123

124124
An :class:`POP3` instance has the following methods:

0 commit comments

Comments
 (0)
0