What is asynchronous transition to Python?

I read about new Python keywords asyncand await. However, they are neither keywords nor reserved in the namespace.

>>> import keyword
>>> keyword.iskeyword("async")
False
>>> async
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'async' is not defined

In this example, I would have expected True, and SyntaxErrorkeyword.

So what exactly is asyncin Python? How it works?

+4
source share
1 answer

async await . async def async def NAME async await async await; NAME async await, .

, Parser/tokenizer.c, PEP 492, PEP, async await.

+4

Source: https://habr.com/ru/post/1674341/


All Articles