pycodestyle
pycodestyle copied to clipboard
W606: false positive when selecting async function from list by index
Using version 2.6.0 in a clean Docker container (python 3.8.2)
Code to reproduce:
import asyncio
async def a(p):
print(p)
async def b():
await [a][0]("hi")
if __name__ == "__main__":
asyncio.run(b())
Output:
root@47c18858d18f:/app# python -m pycodestyle test.py
test.py:9:5: W606 'async' and 'await' are reserved keywords starting with Python 3.7
root@47c18858d18f:/app#
This appears similar to #811, which was also about false positives on W606.