コード例 #1
0
 def visit_instance(self, t: types.Instance) -> Set[str]:
     out = self._visit(t.args)
     if t.type:
         # Uses of a class depend on everything in the MRO,
         # as changes to classes in the MRO can add types to methods,
         # change property types, change the MRO itself, etc.
         for s in t.type.mro:
             out.update(split_module_names(s.module_name))
         if t.type.metaclass_type is not None:
             out.update(split_module_names(t.type.metaclass_type.type.module_name))
     return out
コード例 #2
0
ファイル: indirection.py プロジェクト: chadrik/mypy
 def visit_instance(self, t: types.Instance) -> Set[str]:
     out = self._visit(t.args)
     if t.type:
         # Uses of a class depend on everything in the MRO,
         # as changes to classes in the MRO can add types to methods,
         # change property types, change the MRO itself, etc.
         for s in t.type.mro:
             out.update(split_module_names(s.module_name))
         if t.type.metaclass_type is not None:
             out.update(split_module_names(t.type.metaclass_type.type.module_name))
     return out
コード例 #3
0
def extract_module_names(type_name: Optional[str]) -> List[str]:
    """Returns the module names of a fully qualified type name."""
    if type_name is not None:
        # Discard the first one, which is just the qualified name of the type
        possible_module_names = split_module_names(type_name)
        return possible_module_names[1:]
    else:
        return []
コード例 #4
0
ファイル: indirection.py プロジェクト: chadrik/mypy
def extract_module_names(type_name: Optional[str]) -> List[str]:
    """Returns the module names of a fully qualified type name."""
    if type_name is not None:
        # Discard the first one, which is just the qualified name of the type
        possible_module_names = split_module_names(type_name)
        return possible_module_names[1:]
    else:
        return []
コード例 #5
0
 def visit_instance(self, t: types.Instance) -> Set[str]:
     out = self._visit(*t.args)
     if t.type is not None:
         out.update(split_module_names(t.type.module_name))
     return out
コード例 #6
0
ファイル: indirection.py プロジェクト: AXGKl/Transcrypt
 def visit_instance(self, t: types.Instance) -> Set[str]:
     out = self._visit(*t.args)
     if t.type is not None:
         out.update(split_module_names(t.type.module_name))
     return out