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

pyright incorrectly allows & parses await in lambdas #9406

Closed
jakkdl opened this issue Nov 7, 2024 · 1 comment
Closed

pyright incorrectly allows & parses await in lambdas #9406

jakkdl opened this issue Nov 7, 2024 · 1 comment
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request

Comments

@jakkdl
Copy link

jakkdl commented Nov 7, 2024

Describe the bug
await statements are never allowed in lambda's, but pyright sees no problem with them and treats them as if they're fully valid and will work. Trying to run a file with await in lambda will give a SyntaxError, and mypy also gives an error.

Code or Screenshots

from typing_extensions import assert_type

async def foo() -> int:
    x = lambda: await foo()
    assert_type(x(), int)
    return 5
$ pyright foo.py
0 errors, 0 warnings, 0 informations 

VS Code extension or command-line
command line, version 1.1.388

@jakkdl jakkdl added the bug Something isn't working label Nov 7, 2024
@erictraut erictraut added enhancement request New feature or request and removed bug Something isn't working labels Nov 7, 2024
@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

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 enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants