W606: false positive when selecting async function from list by index
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the provided Python 3.8 reproduction with pycodestyle 2.6.0, then trace the W606 handling that reports the warning for the indexed async function call. Done means the example no longer produces a false-positive W606 diagnostic; add or update a regression test if the project’s existing test structure identifies one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100