Skip to content

Commit 10daef4

Browse files
authored
Merge branch 'main' into fix-fut-callbacks
2 parents d407a0b + 9a11ed8 commit 10daef4

20 files changed

+167
-103
lines changed

Doc/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If you'd like to create the virtual environment in a different location,
4040
you can specify it using the ``VENVDIR`` variable.
4141

4242
You can also skip creating the virtual environment altogether, in which case
43-
the Makefile will look for instances of ``sphinxbuild`` and ``blurb``
43+
the Makefile will look for instances of ``sphinx-build`` and ``blurb``
4444
installed on your process ``PATH`` (configurable with the ``SPHINXBUILD`` and
4545
``BLURB`` variables).
4646

Doc/glossary.rst

+9-2
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,17 @@ Glossary
136136
:exc:`StopAsyncIteration` exception. Introduced by :pep:`492`.
137137

138138
attribute
139-
A value associated with an object which is referenced by name using
140-
dotted expressions. For example, if an object *o* has an attribute
139+
A value associated with an object which is usually referenced by name
140+
using dotted expressions.
141+
For example, if an object *o* has an attribute
141142
*a* it would be referenced as *o.a*.
142143

144+
It is possible to give an object an attribute whose name is not an
145+
identifier as defined by :ref:`identifiers`, for example using
146+
:func:`setattr`, if the object allows it.
147+
Such an attribute will not be accessible using a dotted expression,
148+
and would instead need to be retrieved with :func:`getattr`.
149+
143150
awaitable
144151
An object that can be used in an :keyword:`await` expression. Can be
145152
a :term:`coroutine` or an object with an :meth:`__await__` method.

Doc/library/asyncio-eventloop.rst

+10-1
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,27 @@ Running and stopping the loop
180180

181181
.. versionadded:: 3.6
182182

183-
.. coroutinemethod:: loop.shutdown_default_executor()
183+
.. coroutinemethod:: loop.shutdown_default_executor(timeout=None)
184184

185185
Schedule the closure of the default executor and wait for it to join all of
186186
the threads in the :class:`ThreadPoolExecutor`. After calling this method, a
187187
:exc:`RuntimeError` will be raised if :meth:`loop.run_in_executor` is called
188188
while using the default executor.
189189

190+
The *timeout* parameter specifies the amount of time the executor will
191+
be given to finish joining. The default value is ``None``, which means the
192+
executor will be given an unlimited amount of time.
193+
194+
If the timeout duration is reached, a warning is emitted and executor is
195+
terminated without waiting for its threads to finish joining.
196+
190197
Note that there is no need to call this function when
191198
:func:`asyncio.run` is used.
192199

193200
.. versionadded:: 3.9
194201

202+
.. versionchanged:: 3.12
203+
Added the *timeout* parameter.
195204

196205
Scheduling callbacks
197206
^^^^^^^^^^^^^^^^^^^^

Doc/library/asyncio-policy.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Policies
88
========
99

10-
An event loop policy is a global (per-interpreter) object
10+
An event loop policy is a global object
1111
used to get and set the current :ref:`event loop <asyncio-event-loop>`,
1212
as well as create new event loops.
1313
The default policy can be :ref:`replaced <asyncio-policy-get-set>` with

Doc/library/asyncio-runner.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Running an asyncio Program
2828

2929
This function runs the passed coroutine, taking care of
3030
managing the asyncio event loop, *finalizing asynchronous
31-
generators*, and closing the threadpool.
31+
generators*, and closing the executor.
3232

3333
This function cannot be called when another asyncio event loop is
3434
running in the same thread.
@@ -41,6 +41,10 @@ Running an asyncio Program
4141
the end. It should be used as a main entry point for asyncio
4242
programs, and should ideally only be called once.
4343

44+
The executor is given a timeout duration of 5 minutes to shutdown.
45+
If the executor hasn't finished within that duration, a warning is
46+
emitted and the executor is closed.
47+
4448
Example::
4549

4650
async def main():

Doc/library/functions.rst

+8
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ are always available. They are listed here in alphabetical order.
397397
string. The string must be the name of one of the object's attributes. The
398398
function deletes the named attribute, provided the object allows it. For
399399
example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``.
400+
*name* need not be a Python identifier (see :func:`setattr`).
400401

401402

402403
.. _func-dict:
@@ -738,6 +739,7 @@ are always available. They are listed here in alphabetical order.
738739
value of that attribute. For example, ``getattr(x, 'foobar')`` is equivalent to
739740
``x.foobar``. If the named attribute does not exist, *default* is returned if
740741
provided, otherwise :exc:`AttributeError` is raised.
742+
*name* need not be a Python identifier (see :func:`setattr`).
741743

742744
.. note::
743745

@@ -1582,6 +1584,12 @@ are always available. They are listed here in alphabetical order.
15821584
object allows it. For example, ``setattr(x, 'foobar', 123)`` is equivalent to
15831585
``x.foobar = 123``.
15841586

1587+
*name* need not be a Python identifier as defined in :ref:`identifiers`
1588+
unless the object chooses to enforce that, for example in a custom
1589+
:meth:`~object.__getattribute__` or via :attr:`~object.__slots__`.
1590+
An attribute whose name is not an identifier will not be accessible using
1591+
the dot notation, but is accessible through :func:`getattr` etc..
1592+
15851593
.. note::
15861594

15871595
Since :ref:`private name mangling <private-name-mangling>` happens at

0 commit comments

Comments
 (0)