Skip to content

Commit 274bd01

Browse files
authored
Remove draft status. Add asyncio REPL example (GH-16785)
1 parent d83fc27 commit 274bd01

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@
4747
This article explains the new features in Python 3.8, compared to 3.7.
4848
For full details, see the :ref:`changelog <changelog>`.
4949

50-
Prerelease users should be aware that this document is currently in
51-
draft form. It will be updated as Python 3.8 moves towards release, so
52-
it's worth checking back even after reading earlier versions. Some
53-
notable items not yet covered are:
54-
55-
* :pep:`578` - Runtime audit hooks for potentially sensitive operations
56-
* ``python -m asyncio`` runs a natively async REPL
57-
5850
.. testsetup::
5951

6052
from datetime import date
@@ -287,6 +279,18 @@ calculations can be shown::
287279
(Contributed by Eric V. Smith and Larry Hastings in :issue:`36817`.)
288280

289281

282+
PEP 578: Python Runtime Audit Hooks
283+
-----------------------------------
284+
285+
The PEP adds an Audit Hook and Verified Open Hook. Both are available from
286+
Python and native code, allowing applications and frameworks written in pure
287+
Python code to take advantage of extra notifications, while also allowing
288+
embedders or system administrators to deploy builds of Python where auditing is
289+
always enabled.
290+
291+
See :pep:`578` for full details.
292+
293+
290294
PEP 587: Python Initialization Configuration
291295
--------------------------------------------
292296

@@ -584,6 +588,23 @@ The :func:`ast.parse` function has some new flags:
584588
asyncio
585589
-------
586590

591+
Running ``python -m asyncio`` launches a natively async REPL. This allows rapid
592+
experimentation with code that has a top-level :keyword:`await`. There is no
593+
longer a need to directly call ``asyncio.run()`` which would spawn a new event
594+
loop on every invocation:
595+
596+
.. code-block:: none
597+
598+
$ python -m asyncio
599+
asyncio REPL 3.8.0
600+
Use "await" directly instead of "asyncio.run()".
601+
Type "help", "copyright", "credits" or "license" for more information.
602+
>>> import asyncio
603+
>>> await asyncio.sleep(10, result='hello')
604+
hello
605+
606+
(Contributed by Yury Selivanov in :issue:`37028`.)
607+
587608
On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`.
588609
(Contributed by Victor Stinner in :issue:`34687`.)
589610

0 commit comments

Comments
 (0)