Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tqdm: Fix return type of async for loop #14028

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

Merged
merged 1 commit into from
May 12, 2025
Merged

Conversation

unhealme
Copy link
Contributor

tqdm_asyncio.__anext__ should return _T instead of Awaitable[_T] because it's already defined as an async function

This fixes the below code from reporting

Operator "*" not supported for types "Awaitable[int]" and "Literal[1]"

from tqdm.asyncio import tqdm

async def main():
    async for i in tqdm(range(10)):
        print(i * 1)

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@srittau srittau merged commit 41b2f9e into python:main May 12, 2025
49 checks passed
@unhealme unhealme deleted the tqdm-fixes branch May 12, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants