Skip to content

Commit 9b510b4

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 598fe28 commit 9b510b4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

mypy/checkexpr.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,10 +2714,13 @@ def check_overload_call(
27142714
# See https://github.com/python/mypy/issues/14764#issuecomment-3054510950
27152715
# And https://typing.python.org/en/latest/spec/overload.html#argument-type-expansion
27162716
arg_types = [
2717-
try_expanding_sum_type_to_union(arg_type, arg_type.type.fullname)
2718-
if isinstance(arg_type, Instance) else arg_type
2719-
for arg_type in arg_types
2720-
]
2717+
(
2718+
try_expanding_sum_type_to_union(arg_type, arg_type.type.fullname)
2719+
if isinstance(arg_type, Instance)
2720+
else arg_type
2721+
)
2722+
for arg_type in arg_types
2723+
]
27212724

27222725
# Step 1: Filter call targets to remove ones where the argument counts don't match
27232726
plausible_targets = self.plausible_overload_call_targets(

mypy/typeops.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,6 @@ class Status(Enum):
10501050
]
10511051
return make_simplified_union(items, contract_literals=False)
10521052

1053-
10541053
if isinstance(typ, Instance) and typ.type.fullname == target_fullname:
10551054
if isinstance(typ.last_known_value, LiteralType):
10561055
# fallback for Literal[True] and Literal[False]

0 commit comments

Comments
 (0)