Skip to content

Add W606 warning for async and await keywords in Python 3.7 - #684

Merged
sigmavirus24 merged 1 commit into
PyCQA:masterfrom
jdufresne:async-await
Feb 17, 2018
Merged

Add W606 warning for async and await keywords in Python 3.7#684
sigmavirus24 merged 1 commit into
PyCQA:masterfrom
jdufresne:async-await

Conversation

@jdufresne

Copy link
Copy Markdown
Contributor

From https://docs.python.org/3/whatsnew/3.6.html#new-keywords

async and await are not recommended to be used as variable, class, function or module names. Introduced by PEP 492 in Python 3.5, they will become proper keywords in Python 3.7. Starting in Python 3.6, the use of async or await as names will generate a DeprecationWarning.

By adding a warning to pycodestyle.py these future warnings and syntax errors can be caught during static code analysis.

The await expression tests were taken from PEP-492.

https://www.python.org/dev/peps/pep-0492/#id58

From https://docs.python.org/3/whatsnew/3.6.html#new-keywords

> async and await are not recommended to be used as variable, class,
> function or module names. Introduced by PEP 492 in Python 3.5, they
> will become proper keywords in Python 3.7. Starting in Python 3.6, the
> use of async or await as names will generate a DeprecationWarning.

By adding a warning to pycodestyle.py these future warnings and syntax
errors can be caught during static code analysis.

The await expression tests were taken from PEP-492.

https://www.python.org/dev/peps/pep-0492/#id58
@sigmavirus24
sigmavirus24 merged commit eb91b79 into PyCQA:master Feb 17, 2018
@jdufresne
jdufresne deleted the async-await branch June 2, 2018 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants