You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typing of pathvalidate is incorrect. It uses Union for input/output arguments instead of using generics.
This throws mypy off - it cannot infer exact type of output variable, even if it's easily inferable from code structure.
$ python3 repro.py
2.5.0
<class 'str'><class 'pathlib.PosixPath'>
$ mypy repro.py
repro.py:11: note: Revealed type is "Union[builtins.str, pathlib.Path]"
repro.py:16: note: Revealed type is "Union[builtins.str, pathlib.Path]"
Success: no issues found in 1 source file
Expected output: str type inferred for first reveal_type, pathlib.Path inferred for second reveal_type
The text was updated successfully, but these errors were encountered:
Typing of pathvalidate is incorrect. It uses Union for input/output arguments instead of using generics.
This throws mypy off - it cannot infer exact type of output variable, even if it's easily inferable from code structure.
repro.py
Outputs:
Expected output:
str
type inferred for firstreveal_type
,pathlib.Path
inferred for secondreveal_type
The text was updated successfully, but these errors were encountered: