8000 bpo-33514: Document PEP 492 changes in 3.7 changelog · python/cpython@d4599c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4599c2

Browse files
committed
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.
1 parent 5401622 commit d4599c2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,8 @@ can be used to create instance variables with different implementation details.
684684
:pep:`3129` - Class Decorators
685685

686686

687+
.. _async:
688+
687689
Coroutines
688690
==========
689691

Doc/whatsnew/3.7.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,16 @@ Changes in Python behavior
11571157
exceptions.
11581158
(Contributed by Yury Selivanov in :issue:`32670`.)
11591159

1160+
* :pep:`492` is fully implemented in Python 3.7, meaning that the old
1161+
:meth:`__aiter__` protocol is no longer supported: a
1162+ 6F2F
:exc:`RuntimeError` will be raised if :meth:`__aiter__` returns anything
1163+
but an asynchronous iterator.
1164+
1165+
Since Python 3.7, :keyword:`async` and :keyword:`await` names are proper
1166+
keywords. If you use them for variable names, you need to rename them in
1167+
order to make the code work on Python 3.7. Trying to use a keyword as
1168+
a variable name will raise a :exc:`SyntaxError`.
1169+
11601170
* Due to an oversight, earlier Python versions erroneously accepted the
11611171
following syntax::
11621172

0 commit comments

Comments
 (0)
0