-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-overloadstopic-type-variables
Description
Example:
dct = {"": ""}
# ok
trans = str.maketrans(dct)
"".translate(trans)
# err
"".translate(str.maketrans(dct))
- What is the actual behavior/output?
maketrans.py:8: error: Argument 1 to "maketrans" of "str" has incompatible type "Dict[str, str]"; expected "Union[Dict[int, Union[int, str, None]], Dict[str, Union[int, str, None]], Dict[Union[str, int], Union[int, str, None]]]"
- What is the behavior/output you expect?
No error.
- What are the versions of mypy and Python you are using?
I tested both mypy 0.610 and mypy 0.620+dev-0ca6bf9ce63439a1e8bcc4dec80ef12f8414cb87 with Python 3.6.5; behavior is identical.
sbdchd, Molkree, matangover, VShkaberda and predakanga
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-overloadstopic-type-variables