def visit_tuple(self, node: astroid.Tuple) -> None: if node.ctx == astroid.Store: # Tuple is the target of an assignment; do not give it a type. node.inf_type = NoType() else: node.inf_type = wrap_container(Tuple, *(e.inf_type for e in node.elts))
def get_inner_tuple_types(tuple_node: astroid.Tuple) -> List[str]: # avoid using Set to keep order inner_types: List[str] = [] for child in tuple_node.get_children(): child_type = helper(child) if child_type not in inner_types: inner_types.append(child_type) return inner_types