-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Ignore promotions when simplifying unions #13781
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
Conversation
Diff from mypy_primer, showing the effect of this PR on open source code: operator (https://github.com/canonical/operator)
- ops/model.py:2198: error: Incompatible types in assignment (expression has type "Iterable[str]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2198: error: Incompatible types in assignment (expression has type "Iterable[str]", variable has type "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2199: error: Item "int" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2199: error: Item "float" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "float" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2199: error: Item "Dict[str, JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "Dict[str, JsonObject]" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2199: error: Item "List[JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "List[JsonObject]" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2199: error: Item "Tuple[JsonObject, ...]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "Tuple[JsonObject, ...]" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2199: error: Item "int" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
- ops/model.py:2199: error: Item "float" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2199: error: Item "float" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
- ops/model.py:2199: error: Item "None" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2199: error: Item "None" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
- ops/model.py:2354: error: Incompatible types in assignment (expression has type "Dict[str, Dict[str, str]]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2354: error: Incompatible types in assignment (expression has type "Dict[str, Dict[str, str]]", variable has type "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
- ops/model.py:2355: error: Value of type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" is not indexable [index]
+ ops/model.py:2355: error: Value of type "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" is not indexable [index]
- ops/model.py:2355: error: Invalid index type "str" for "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]"; expected type "Union[SupportsIndex, slice]" [index]
+ ops/model.py:2355: error: Invalid index type "str" for "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]"; expected type "Union[SupportsIndex, slice]" [index]
- ops/model.py:2356: error: Value of type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" is not indexable [index]
+ ops/model.py:2356: error: Value of type "Union[str, Any, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" is not indexable [index]
- ops/model.py:2356: error: Incompatible types (expression has type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]", TypedDict item "status" has type "str") [typeddict-item]
+ ops/model.py:2356: error: Incompatible types (expression has type "Union[str, Any, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]", TypedDict item "status" has type "str") [typeddict-item]
- ops/model.py:2356: error: Invalid index type "str" for "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]"; expected type "Union[SupportsIndex, slice]" [index]
+ ops/model.py:2356: error: Invalid index type "str" for "Union[str, Any, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]"; expected type "Union[SupportsIndex, slice]" [index]
- ops/model.py:2357: error: Value of type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" is not indexable [index]
+ ops/model.py:2357: error: Value of type "Union[str, Any, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" is not indexable [index]
- ops/model.py:2357: error: Incompatible types (expression has type "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]", TypedDict item "message" has type "str") [typeddict-item]
+ ops/model.py:2357: error: Incompatible types (expression has type "Union[str, Any, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]", TypedDict item "message" has type "str") [typeddict-item]
- ops/model.py:2357: error: Invalid index type "str" for "Union[str, Any, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]"; expected type "Union[SupportsIndex, slice]" [index]
+ ops/model.py:2357: error: Invalid index type "str" for "Union[str, Any, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]"; expected type "Union[SupportsIndex, slice]" [index]
- ops/model.py:2376: error: Incompatible types in assignment (expression has type "List[str]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2376: error: Incompatible types in assignment (expression has type "List[str]", variable has type "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2377: error: Item "int" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2377: error: Item "float" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "float" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2377: error: Item "Dict[str, JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "Dict[str, JsonObject]" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2377: error: Item "List[JsonObject]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "List[JsonObject]" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
- ops/model.py:2377: error: Item "Tuple[JsonObject, ...]" of "Union[Any, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "Tuple[JsonObject, ...]" of "Union[Any, int, float, str, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...]]" has no attribute "split" [union-attr]
+ ops/model.py:2377: error: Item "int" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
- ops/model.py:2377: error: Item "float" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2377: error: Item "float" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
- ops/model.py:2377: error: Item "None" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
+ ops/model.py:2377: error: Item "None" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "__iter__" (not iterable) [union-attr]
- ops/model.py:2491: error: Incompatible types in assignment (expression has type "Dict[str, List[str]]", variable has type "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
+ ops/model.py:2491: error: Incompatible types in assignment (expression has type "Dict[str, List[str]]", variable has type "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]") [assignment]
- ops/model.py:2493: error: Item "str" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "str" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "int" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
- ops/model.py:2493: error: Item "float" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "float" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
- ops/model.py:2493: error: Item "List[JsonObject]" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "List[JsonObject]" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
- ops/model.py:2493: error: Item "Tuple[JsonObject, ...]" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "Tuple[JsonObject, ...]" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
- ops/model.py:2493: error: Item "None" of "Union[str, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
+ ops/model.py:2493: error: Item "None" of "Union[str, int, float, Dict[str, JsonObject], List[JsonObject], Tuple[JsonObject, ...], None]" has no attribute "get" [union-attr]
- ops/model.py:2493: error: Argument 1 to "len" has incompatible type "Union[Any, float, Sized]"; expected "Sized" [arg-type]
+ ops/model.py:2493: error: Argument 1 to "len" has incompatible type "Union[Any, int, float, Sized]"; expected "Sized" [arg-type]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/test_resampler.py:277: error: Expression is of type "Union[str, bytes, date, timedelta, complex]", not "Union[str, bytes, date, datetime, timedelta, bool, int, float, complex, Timestamp, Timedelta]" [assert-type]
psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/enum.py:40: error: Unused "type: ignore" comment
discord.py (https://github.com/Rapptz/discord.py)
- discord/backoff.py:75: error: Incompatible types in assignment (expression has type "function", variable has type "Callable[..., float]") [assignment]
+ discord/backoff.py:75: error: Incompatible types in assignment (expression has type "function", variable has type "Callable[..., Union[int, float]]") [assignment]
- discord/scheduled_event.py:160: note: def __new__(cls, Union[str, bytes, array[Any], mmap, _CData, PickleBuffer, SupportsInt, SupportsIndex, SupportsTrunc] = ..., /) -> int
+ discord/scheduled_event.py:160: note: def __new__(cls, Union[str, bytes, bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer, SupportsInt, SupportsIndex, SupportsTrunc] = ..., /) -> int
- discord/scheduled_event.py:160: note: def __new__(cls, Union[str, bytes], /, base: SupportsIndex) -> int
+ discord/scheduled_event.py:160: note: def __new__(cls, Union[str, bytes, bytearray], /, base: SupportsIndex) -> int
- discord/app_commands/models.py:205: note: def __new__(cls, Union[str, bytes, array[Any], mmap, _CData, PickleBuffer, SupportsInt, SupportsIndex, SupportsTrunc] = ..., /) -> int
+ discord/app_commands/models.py:205: note: def __new__(cls, Union[str, bytes, bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer, SupportsInt, SupportsIndex, SupportsTrunc] = ..., /) -> int
- discord/app_commands/models.py:205: note: def __new__(cls, Union[str, bytes], /, base: SupportsIndex) -> int
+ discord/app_commands/models.py:205: note: def __new__(cls, Union[str, bytes, bytearray], /, base: SupportsIndex) -> int
- discord/app_commands/models.py:448: error: Incompatible types in assignment (expression has type "Union[str, float]", variable has type "str") [assignment]
+ discord/app_commands/models.py:448: error: Incompatible types in assignment (expression has type "Union[str, int, float]", variable has type "str") [assignment]
- discord/app_commands/models.py:448: error: Incompatible types in assignment (expression has type "Union[str, float]", variable has type "int") [assignment]
+ discord/app_commands/models.py:448: error: Incompatible types in assignment (expression has type "Union[str, int, float]", variable has type "int") [assignment]
- discord/app_commands/models.py:448: error: Incompatible types in assignment (expression has type "Union[str, float]", variable has type "float") [assignment]
+ discord/app_commands/models.py:448: error: Incompatible types in assignment (expression has type "Union[str, int, float]", variable has type "float") [assignment]
- discord/app_commands/models.py:505: error: Incompatible types in assignment (expression has type "Dict[str, str]", target has type "Union[str, float]") [assignment]
+ discord/app_commands/models.py:505: error: Incompatible types in assignment (expression has type "Dict[str, str]", target has type "Union[str, int, float]") [assignment]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "str" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "str" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Iterable[str]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Iterable[str]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "float" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "float" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[float]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Optional[float]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "bool" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "bool" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[BasicAuth]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Optional[BasicAuth]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[str]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Optional[str]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[Mapping[str, str]]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Optional[Mapping[str, str]]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[Mapping[Union[str, istr], str], CIMultiDict[str], CIMultiDictProxy[str], None]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Union[Mapping[Union[str, istr], str], CIMultiDict[str], CIMultiDictProxy[str], None]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[str, URL, None]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Union[str, URL, None]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Union[SSLContext, bool, None, Fingerprint]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Union[SSLContext, bool, None, Fingerprint]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[bool]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Optional[bool]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[bytes]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Optional[bytes]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "Optional[SSLContext]" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "Optional[SSLContext]" [arg-type]
- discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, BasicAuth, None, str]]"; expected "int" [arg-type]
+ discord/http.py:536: error: Argument 2 to "ws_connect" of "ClientSession" has incompatible type "**Dict[str, Union[Dict[str, str], float, int, BasicAuth, None, str]]"; expected "int" [arg-type]
- discord/app_commands/transformers.py:147: error: Incompatible types in assignment (expression has type "float", target has type "Union[str, int]") [assignment]
+ discord/app_commands/transformers.py:147: error: Incompatible types in assignment (expression has type "Union[int, float]", target has type "Union[str, int]") [assignment]
- discord/app_commands/transformers.py:149: error: Incompatible types in assignment (expression has type "float", target has type "Union[str, int]") [assignment]
+ discord/app_commands/transformers.py:149: error: Incompatible types in assignment (expression has type "Union[int, float]", target has type "Union[str, int]") [assignment]
streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/elements/metric.py: note: In member "parse_delta" of class "MetricMixin":
+ lib/streamlit/elements/metric.py:163:25: error: Subclass of "float" and "int" cannot exist: would have incompatible method signatures [unreachable]
pylint (https://github.com/pycqa/pylint)
+ pylint/checkers/__init__.py:130: error: Argument 1 to "extend" of "list" has incompatible type "Tuple[str, str, str, Union[str, int]]"; expected "Iterable[str]" [arg-type]
aioredis (https://github.com/aio-libs/aioredis)
+ aioredis/connection.py:933: error: Unsupported right operand type for in ("Union[bytes, memoryview, int]") [operator]
+ aioredis/connection.py:934: error: Item "memoryview" of "Union[bytes, memoryview, int]" has no attribute "split" [union-attr]
+ aioredis/connection.py:934: error: Item "int" of "Union[bytes, memoryview, int]" has no attribute "split" [union-attr]
- aioredis/client.py:4114: error: Incompatible types in assignment (expression has type "Dict[Union[bytes, str], Optional[Any]]", variable has type "Dict[Union[bytes, str, memoryview], Callable[[Dict[str, str]], Awaitable[None]]]") [assignment]
+ aioredis/client.py:4114: error: Incompatible types in assignment (expression has type "Dict[Union[bytes, str, memoryview], Optional[Any]]", variable has type "Dict[Union[bytes, str, memoryview], Callable[[Dict[str, str]], Awaitable[None]]]") [assignment]
- aioredis/client.py:4158: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[Union[bytes, str], Optional[Any]]"; expected "SupportsKeysAndGetItem[Union[bytes, str, memoryview], Callable[[Dict[str, str]], Awaitable[None]]]" [arg-type]
+ aioredis/client.py:4158: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[Union[bytes, str, memoryview], Optional[Any]]"; expected "SupportsKeysAndGetItem[Union[bytes, str, memoryview], Callable[[Dict[str, str]], Awaitable[None]]]" [arg-type]
core (https://github.com/home-assistant/core)
- homeassistant/components/deconz/sensor.py:110: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:110: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:117: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:117: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:128: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:128: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:137: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:137: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:145: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:145: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:151: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:151: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:160: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:160: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:169: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:169: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:178: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:178: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:187: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:187: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:204: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:204: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
- homeassistant/components/deconz/sensor.py:215: error: Returning Any from function declared to return "Union[datetime, None, str, float]" [no-any-return]
+ homeassistant/components/deconz/sensor.py:215: error: Returning Any from function declared to return "Union[datetime, None, str, int, float]" [no-any-return]
|
Few new errors are actually valid (and maybe actually catching actual bugs), except the one in |
Yes, it looks like it is caused by this PR, a simple repro: x: float
if isinstance(x, int) or isinstance(x, float):
pass it worked before, but fails with this PR. |
Oh wait, it only happens with a |
This is ready for review then. |
@JukkaL if you have no objections, I will merge this latter today. |
@ilevkivskyi Any sense as to when this fix will be released? |
As part of 0.990, probably in a month or so |
Fixes #13760
Fixes #6060
Fixes #12824
This is a right thing to do, but let's what
mypy_primer
will be. This also required re-applying #6181 (which is also a right thing to do) otherwise some tests fail.