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

[flake8-async] ASYNC100 false positive in async generator expressions #13637

Open
autinerd opened this issue Oct 5, 2024 · 0 comments · May be fixed by #13639
Open

[flake8-async] ASYNC100 false positive in async generator expressions #13637

autinerd opened this issue Oct 5, 2024 · 0 comments · May be fixed by #13639
Labels
bug Something isn't working good first issue Good for newcomers rule Implementing or modifying a lint rule

Comments

@autinerd
Copy link
Contributor

autinerd commented Oct 5, 2024

Hi!

ASYNC100 doesn't trigger with this code:

import asyncio

async def long_running_range():
    for i in range(10):
        await asyncio.sleep(2)
        yield i

async def main():
    async with asyncio.timeout(7):
        async for i in long_running_range():
            print(i)

asyncio.run(main())

but it does with this code:

import asyncio

async def long_running_range():
    for i in range(10):
        await asyncio.sleep(2)
        yield i

async def main():
    async with asyncio.timeout(7):
        print({i async for i in long_running_range()})

asyncio.run(main())

Thanks!

@autinerd autinerd linked a pull request Oct 5, 2024 that will close this issue
@zanieb zanieb added bug Something isn't working rule Implementing or modifying a lint rule good first issue Good for newcomers labels Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants