We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems like at this point retype doesn't support overloaded annotations. Tested with example annotation (foo.pyi):
overloaded
foo.pyi
from typing import overload @overload def f(x: str) -> str: ... @overload def f(x: int) -> int: ...
and source file (foo.py)
foo.py
def f(x): if isinstance(x, (str, int)): return x else: raise TypeError(f"x should be str or int, got {type(x)}")
Executing retype results in
retype
error: /path/to/foo.py: Annotation problem in function 'f': 1:1: incompatible existing annotation for {arg.arg!r}. Expected: 'int', actual: 'str'
Expected output would be
from typing import overload @overload def f(x: str) -> str: ... @overload def f(x: int) -> int: ... def f(x): if isinstance(x, (str, int)): return x else: raise TypeError(f"x should be str or int, got {type(x)}")
or equivalent.
The text was updated successfully, but these errors were encountered:
This project is being retired and archived, so we'll no longer address this.
Sorry, something went wrong.
No branches or pull requests
It seems like at this point retype doesn't support
overloaded
annotations. Tested with example annotation (foo.pyi
):and source file (
foo.py
)Executing
retype
results inExpected output would be
or equivalent.
The text was updated successfully, but these errors were encountered: