-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Several errors in overloaded functions in the stdlib #9608
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
Comments
There are several functions in |
I'm not sure anyone understands asyncio ... |
Other than the asyncio ones, all the fixable ones that I know about have now been fixed (though we'll probably discover a few more once JelleZijlstra/stubdefaulter#35 is implemented...). I'll open a followup issue for the asyncio ones. Many thanks, everybody, for the speedy reviews on my PRs! |
Attempting to add defaults to overloaded functions in #9606 highlighted many instances where we have incorrect overloads in the stdlib. An example is this overload in
_bisect.pyi
:typeshed/stdlib/_bisect.pyi
Lines 13 to 21 in 808a431
This overload incorrectly marks the
key
parameter as having a default value. But this has several issues:_T
TypeVar would go unsolved if no value was specified for thekey
parameter.None
), mypy will (correctly) complain that we're using an implicit optional type for the type annotation.There are several issues like this in our stdlib stubs that should be fixed (see b39305e for a summary of the problematic functions — this is the commit in #9606 in which I reverted all the defaults
stubdefaulter
had added that caused mypy to emit errors).The text was updated successfully, but these errors were encountered: