We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1bb818 commit 5f87a69Copy full SHA for 5f87a69
mypyc/irbuild/builder.py
@@ -990,8 +990,10 @@ def get_sequence_type_from_type(self, target_type: Type) -> RType:
990
elif isinstance(target_type, TypeVarLikeType):
991
return self.get_sequence_type_from_type(target_type.upper_bound)
992
elif isinstance(target_type, TupleType):
993
+ items = target_type.items
994
+ assert items, f"This function does not support empty tuples"
995
# Tuple might have elements of different types.
- rtypes = {self.mapper.type_to_rtype(item) for item in target_type.items}
996
+ rtypes = set(map(self.mapper.type_to_rtype, items))
997
if len(rtypes) == 1:
998
return rtypes.pop()
999
else:
0 commit comments