Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jul 29, 2023
1 parent 8e2297e commit 623f01f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4592,14 +4592,11 @@ def analyze_iterable_item_type(self, expr: Expression) -> tuple[Type, Type]:
if int_type:
return iterator, int_type

if isinstance(iterable, TupleType):
if (
isinstance(iterable, TupleType)
and iterable.partial_fallback.type.fullname == "builtins.tuple"
):
joined: Type = UninhabitedType()
if iterable.partial_fallback.type.fullname != "builtins.tuple":
# If we're some fancier tuple variant, join with the item type
item_type = echk.check_method_call_by_name("__next__", iterator, [], [], expr)[0]
if not isinstance(get_proper_type(item_type), AnyType):
joined = item_type

for item in iterable.items:
joined = join_types(joined, item)
return iterator, joined
Expand Down

0 comments on commit 623f01f

Please sign in to comment.