Exemplo n.º 1
0
 def def_alias_2(self, base: Instance) -> Tuple[TypeAliasType, Type]:
     A = TypeAliasType(None, [])
     target = UnionType([base,
                         Instance(self.std_tuplei, [A])])  # A = Union[base, Tuple[A, ...]]
     AN = TypeAlias(target, '__main__.A', -1, -1)
     A.alias = AN
     return A, target
Exemplo n.º 2
0
 def visit_type_alias_type(self, t: TypeAliasType) -> None:
     type_ref = t.type_ref
     if type_ref is None:
         return  # We've already been here.
     t.type_ref = None
     t.alias = lookup_qualified_alias(self.modules, type_ref, self.allow_missing)
     for a in t.args:
         a.accept(self)
Exemplo n.º 3
0
 def visit_type_alias_type(self, typ: TypeAliasType) -> None:
     assert typ.alias is not None
     typ.alias = self.fixup(typ.alias)
     for arg in typ.args:
         arg.accept(self)