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

TYP simplify overloads of mypy issue is resolved #40350

Closed
MarcoGorelli opened this issue Mar 10, 2021 · 1 comment
Closed

TYP simplify overloads of mypy issue is resolved #40350

MarcoGorelli opened this issue Mar 10, 2021 · 1 comment
Labels
Typing type annotations, mypy/pyright type checking

Comments

@MarcoGorelli
Copy link
Member

Due to python/mypy#6580 , we've had to add lots of overloads to #40200 - if that issue was resolved, they could be removed

Also, if python/mypy#10194 was recognised as a bug and resolved, then the extra overload for the bool case in #40200 (and any others of that kind) could be removed

@MarcoGorelli MarcoGorelli added the Typing type annotations, mypy/pyright type checking label Mar 10, 2021
@MarcoGorelli
Copy link
Member Author

closing as it seems that bool isn't the union of Literal[True] and Literal[False] in any case, it's not an overload-specific thing:

$ cat t.py 
from typing import Literal, Union

def foo(x: Literal[True, False]) -> None:
    return None

x: bool
foo(x)
$ mypy t.py
t.py:7: error: Argument 1 to "foo" has incompatible type "bool"; expected "Union[Literal[True], Literal[False]]"
Found 1 error in 1 file (checked 1 source file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

No branches or pull requests

1 participant