|
8 | 8 | from collections import defaultdict |
9 | 9 | from collections.abc import Iterable, Iterator, Sequence |
10 | 10 | from contextlib import contextmanager |
11 | | -from typing import Callable, ClassVar, Final, Optional, cast, overload |
| 11 | +from typing import Any, Callable, ClassVar, Final, Optional, cast, overload |
12 | 12 | from typing_extensions import TypeAlias as _TypeAlias, assert_never |
13 | 13 |
|
14 | 14 | import mypy.checker |
@@ -3587,7 +3587,7 @@ def visit_op_expr(self, e: OpExpr) -> Type: |
3587 | 3587 |
|
3588 | 3588 | def literal_value_from_expr( |
3589 | 3589 | self, expr: Expression, typ: Type |
3590 | | - ) -> tuple[list[str | int], str, bool] | None: |
| 3590 | + ) -> tuple[list[Any], str, bool] | None: |
3591 | 3591 | if isinstance(expr, StrExpr): |
3592 | 3592 | return [expr.value], "builtins.str", False |
3593 | 3593 | if isinstance(expr, IntExpr): |
@@ -3632,10 +3632,7 @@ def literal_expression_addition( |
3632 | 3632 | return None |
3633 | 3633 |
|
3634 | 3634 | values: list[int | str] = sorted( |
3635 | | - { |
3636 | | - val[0] + val[1] # type: ignore[operator] |
3637 | | - for val in itertools.product(lvalue[0], rvalue[0]) |
3638 | | - } |
| 3635 | + {val[0] + val[1] for val in itertools.product(lvalue[0], rvalue[0])} |
3639 | 3636 | ) |
3640 | 3637 | if len(values) == 1: |
3641 | 3638 | return LiteralType(values[0], self.named_type(lvalue[1])) |
|
0 commit comments