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

add tqdm stub #6088

Closed
wants to merge 6 commits into from
Closed

add tqdm stub #6088

wants to merge 6 commits into from

Conversation

casperdcl
Copy link

@casperdcl casperdcl commented Sep 29, 2021

failing tests due to mypy bug python/mypy#8625

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.

A few quick notes, not a thorough review yet.

@@ -0,0 +1,2 @@
version = "4.62"
python2 = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

While tqdm supports Python 2, the stubs don't seem to be take Python 2 into account. In this case, just leave out the python2 marker. Python 2 support in typeshed is not a priority anymore and hinders other improvements.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
python2 = true

@@ -0,0 +1,127 @@
from _typeshed import Self
from typing import Any, Dict, Iterable, Iterator, TypeVar
Copy link
Collaborator

Choose a reason for hiding this comment

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

Iterable and Iterator should be imported from collections.abc.


_T = TypeVar("_T")

class tqdm(Comparable):
Copy link
Collaborator

Choose a reason for hiding this comment

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

tqdm needs to be generic over _T for the type vars below to work.

@srittau srittau closed this Feb 2, 2022
@srittau srittau reopened this Feb 2, 2022
@srittau
Copy link
Collaborator

srittau commented Feb 2, 2022

mypy seems ok now, but this still fails, partly due to the issues I pointed out above.

@JelleZijlstra
Copy link
Member

I was going to try to apply some fixes, but looks like the OP didn't give maintainers permission to push to their branch. Since they haven't responded in ~5 months, I'm going to close this PR. Feel free to reopen it and address Sebastian's comments whenever you're ready.

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.

3 participants