-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
add tqdm
stub
#6088
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python2 = true |
@@ -0,0 +1,127 @@ | |||
from _typeshed import Self | |||
from typing import Any, Dict, Iterable, Iterator, TypeVar |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
mypy seems ok now, but this still fails, partly due to the issues I pointed out above. |
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. |
failing tests due to
mypy
bug python/mypy#8625