await-not-async missed & false alarms with genexp and list comprehensions #18124
Labels
bug
mypy got something wrong
good-first-issue
topic-async
async, await, asyncio
topic-runtime-semantics
mypy doesn't model runtime semantics correctly
Bug Report
await-not-async does not warn on
async for
in list and dict comprehensions, and incorrectly does give a warning forawait
insideGeneratorExp.elt
.For list & dict comprehensions you should error on any
await
orasync for
, but for generator expressions it's only the generator that should be checked.To Reproduce
Expected Behavior
It should error on 8, 9, 12 and 13
Actual Behavior
Your Environment
mypy.ini
(and other config files):also see astral-sh/ruff#14167 that had the exact same issues
The text was updated successfully, but these errors were encountered: