-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Confusion on return type of difflib.get_closest_matches #3906
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
As you mentioned in the linked PR, this is a duplicate of GH-2067 (and python/mypy#1965). Generally it's not a good idea to re-file an issue. In this particular case, it is possible to |
Hi @McSinyx I had a discussion with @pradyunsg and he mentioned that #2067 is in fact definitely a different bug, hence I have filed this bug. |
s/not a different/definitely a different/ |
This does sound like the same issue as #2067. As I said there, it's fixable with an overload, and I just submitted #3908 doing that. Here's the relevant behavior:
|
Thanks @JelleZijlstra for the quickaround and the fix. Really appreciate it 😄 |
There is a mismatch between the return type mentioned in the docs of difflib.get_close_matches (
List[str]
) vs what is mentioned in typeshed source code (List[Sequence[_T]]
)This was observed when I was trying to add type annotations to https://github.com/pypa/pip/blob/master/src/pip/_internal/commands/__init__.py#L103
The text was updated successfully, but these errors were encountered: