From d4599c29be9682993472f9a7c1a6d035b326f253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 15 May 2018 12:30:20 +0200 Subject: [PATCH] bpo-33514: Document PEP 492 changes in 3.7 changelog Based on PEP 492, old __aiter__ protocol is no longer supported and async and await are now keywords. --- Doc/reference/compound_stmts.rst | 2 ++ Doc/whatsnew/3.7.rst | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 153e85b3949175..5076e5df00789a 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -684,6 +684,8 @@ can be used to create instance variables with different implementation details. :pep:`3129` - Class Decorators +.. _async: + Coroutines ========== diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index cc762736a0c7cb..a90c0df73ee2b9 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1157,6 +1157,16 @@ Changes in Python behavior exceptions. (Contributed by Yury Selivanov in :issue:`32670`.) +* :pep:`492` is fully implemented in Python 3.7, meaning that the old + :meth:`__aiter__` protocol is no longer supported: a + :exc:`RuntimeError` will be raised if :meth:`__aiter__` returns anything + but an asynchronous iterator. + + Since Python 3.7, :keyword:`async` and :keyword:`await` names are proper + keywords. If you use them for variable names, you need to rename them in + order to make the code work on Python 3.7. Trying to use a keyword as + a variable name will raise a :exc:`SyntaxError`. + * Due to an oversight, earlier Python versions erroneously accepted the following syntax::