Change tuple[]
repr to tuple[()]
by sobolevn · Pull Request #15783 · python/mypy (original) (raw)
Diff from mypy_primer, showing the effect of this PR on open source code:
steam.py (https://github.com/Gobot1234/steam.py)
- steam/protobufs/struct_messages.py:24: error: Incompatible types in assignment (expression has type "tuple[]", variable has type "dict[str, Any]") [assignment]
- steam/protobufs/struct_messages.py:24: error: Incompatible types in assignment (expression has type "tuple[()]", variable has type "dict[str, Any]") [assignment]
sublime_debugger (https://github.com/daveleroy/sublime_debugger)
- modules/ui/layout.py:264: error: Incompatible types in assignment (expression has type "tuple[Any, Any | int, Any | int, Any | int, Any, Any]", variable has type "tuple[]") [assignment]
- modules/ui/layout.py:264: error: Incompatible types in assignment (expression has type "tuple[Any, Any | int, Any | int, Any | int, Any, Any]", variable has type "tuple[()]") [assignment]
discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/tasks/init.py:497: error: Incompatible types in assignment (expression has type "tuple[]", variable has type "tuple[type[OSError], type[GatewayNotFound], type[ConnectionClosed], type[ClientError], type[TimeoutError]]") [assignment]
- discord/ext/tasks/init.py:497: error: Incompatible types in assignment (expression has type "tuple[()]", variable has type "tuple[type[OSError], type[GatewayNotFound], type[ConnectionClosed], type[ClientError], type[TimeoutError]]") [assignment]
streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/elements/date_input_test.py:174:16: error: Non-overlapping equality check (left operand type: "Union[date, Tuple[], Tuple[date], Tuple[date, date]]", right operand type: "List[datetime]") [comparison-overlap]
- lib/tests/streamlit/elements/date_input_test.py:174:16: error: Non-overlapping equality check (left operand type: "Union[date, Tuple[()], Tuple[date], Tuple[date, date]]", right operand type: "List[datetime]") [comparison-overlap]
pydantic (https://github.com/samuelcolvin/pydantic)
- pydantic/v1/typing.py:47: error: Incompatible types in assignment (expression has type "tuple[]", variable has type "type[GenericAlias]") [assignment]
- pydantic/v1/typing.py:47: error: Incompatible types in assignment (expression has type "tuple[()]", variable has type "type[GenericAlias]") [assignment]
- pydantic/v1/typing.py:53: error: Incompatible types in assignment (expression has type "tuple[]", variable has type "type[UnionType]") [assignment]
- pydantic/v1/typing.py:53: error: Incompatible types in assignment (expression has type "tuple[()]", variable has type "type[UnionType]") [assignment]