class LookupExternalTypes(_RemoveTypeParametersFromGenericAny, _ToTypeVisitor): (source)
Look up NamedType pointers using a symbol table.
Method | __init__ |
Create this visitor. |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Try to look up a NamedType. |
Method |
|
Add star imports to the ast. |
Instance Variable | name |
Undocumented |
Method | _ |
Undocumented |
Method | _ |
Undocumented |
Method | _ |
Handle duplicate module-level aliases. |
Method | _ |
Get the new members that would result from a star import of the module. |
Method | _ |
Undocumented |
Method | _ |
Undocumented |
Method | _ |
Undocumented |
Method | _ |
Try to resolve an identifier using the top level __getattr__ function. |
Method | _ |
Try to use any star imports in 'module' to resolve 'name'. |
Instance Variable | _alias |
Undocumented |
Instance Variable | _in |
Undocumented |
Instance Variable | _module |
Undocumented |
Instance Variable | _module |
Undocumented |
Instance Variable | _star |
Undocumented |
Instance Variable | _unit |
Undocumented |
Inherited from _RemoveTypeParametersFromGenericAny
:
Class Variable | unchecked |
Undocumented |
Inherited from _ToTypeVisitor
(via _RemoveTypeParametersFromGenericAny
):
Method |
|
Undocumented |
Method |
|
Undocumented |
Method | to |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | _in |
Undocumented |
Instance Variable | _in |
Undocumented |
Inherited from Visitor
(via _RemoveTypeParametersFromGenericAny
, _ToTypeVisitor
):
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Class Variable | old |
Undocumented |
Class Variable | visits |
Undocumented |
Instance Variable | enter |
Undocumented |
Instance Variable | leave |
Undocumented |
Instance Variable | visit |
Undocumented |
Instance Variable | visit |
Undocumented |
Class Variable | _visitor |
Undocumented |
Create this visitor. Args: module_map: A dictionary mapping module names to symbol tables. self_name: The name of the current module. If provided, then the visitor will ignore nodes with this module name. module_alias_map: A dictionary mapping module aliases to real module names. If the source contains "import X as Y", module_alias_map should contain an entry mapping "Y": "X".
Try to look up a NamedType. Args: t: An instance of pytd.NamedType Returns: The same node t. Raises: KeyError: If we can't find a module, or an identifier in a module, or if an identifier in a module isn't a class.
Add star imports to the ast. Args: node: A pytd.TypeDeclUnit instance. Returns: The pytd.TypeDeclUnit instance, with star imports added. Raises: KeyError: If a duplicate member is found during import.
Handle duplicate module-level aliases. Aliases pointing to qualified names could be the result of importing the same entity through multiple import paths, which should not count as an error; instead we just deduplicate them. Args: new_aliases: The list of new aliases to deduplicate Returns: A deduplicated list of aliases. Raises: KeyError: If there is a name clash.
Get the new members that would result from a star import of the module. Args: module: The module name. Returns: A tuple of: - a list of new aliases, - a set of new __getattr__ functions.