@@ -283,7 +283,7 @@ def is_iterable(self, typ: Type) -> bool:
283283 return is_subtype (typ , self .context .iterable_type )
284284
285285 def is_iterable_instance_type (self , typ : Type ) -> TypeGuard [IterableType ]:
286- """Check if the type is an Iterable[T] or a subtype of it ."""
286+ """Check if the type is an Iterable[T]."""
287287 p_t = get_proper_type (typ )
288288 return isinstance (p_t , Instance ) and p_t .type == self .context .iterable_type .type
289289
@@ -363,7 +363,10 @@ def as_iterable_type(self, typ: Type) -> IterableType | AnyType:
363363 if self .is_iterable_instance_type (r ):
364364 args .append (r .args [0 ])
365365 else :
366- # this *should* never happen
366+ # this *should* never happen, since UnpackType should
367+ # only contain TypeVarTuple or a variable length tuple.
368+ # However, we could get an `AnyType(TypeOfAny.from_error)`
369+ # if for some reason the solver was triggered and failed.
367370 args .append (r )
368371 else :
369372 args .append (p_e )
@@ -416,7 +419,7 @@ def parse_star_args_type(
416419 else :
417420 converted_types = [self .as_iterable_type (p_i ) for p_i in proper_items ]
418421 if all (self .is_iterable_instance_type (it ) for it in converted_types ):
419- # all items are iterable, return Iterable[T₁ | T₂ | ... | Tₙ ]
422+ # all items are iterable, return Iterable[T1 | T2 | ... | Tn ]
420423 iterables = cast (list [IterableType ], converted_types )
421424 arg = make_simplified_union ([it .args [0 ] for it in iterables ])
422425 return self ._make_iterable_instance_type (arg )
0 commit comments