Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax check for await within non-async function is missing some conditions #9414

Closed
erictraut opened this issue Nov 7, 2024 · 1 comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working

Comments

@erictraut
Copy link
Collaborator

The four lines below should all be flagged as syntax errors, but only two of them are:

from typing import Any

def foo() -> Any: ...

def should_error():
    [x async for x in foo()]
    {k: v async for k, v in foo()}
    (x for x in await foo())
    [await x for x in foo()]

This comes from the mypy issue tracker: python/mypy#18124

@erictraut erictraut added the bug Something isn't working label Nov 7, 2024
erictraut added a commit that referenced this issue Nov 7, 2024
…st, set and dictionary comprehensions within a non-async function. This addresses #9414.
erictraut added a commit that referenced this issue Nov 7, 2024
…st, set and dictionary comprehensions within a non-async function. This addresses #9414. (#9421)
@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label Nov 7, 2024
@erictraut
Copy link
Collaborator Author

This is addressed in pyright 1.1.389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant