class PrintVisitor(base_visitor.Visitor): (source)
Visitor for converting ASTs back to pytd source code.
Method | __init__ |
Undocumented |
Method |
|
Undocumented |
Method |
|
Entering a class - record class name for children's use. |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Capitalize a generic type, if necessary. |
Method |
|
Undocumented |
Method |
|
Convert an import or alias to a string (or None if handled elsewhere). |
Method |
|
Undocumented |
Method |
|
Convert an anything type to a string. |
Method |
|
Undocumented |
Method |
|
Visit a class, producing a multi-line, properly indented string. |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Convert a class-level or module-level constant to a string. |
Method |
|
Visit function, producing multi-line string (one for each signature). |
Method |
|
Convert a generic type to a string. |
Method |
|
Convert a intersection type ("x and y") to a string. |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Convert a type to a string. |
Method |
|
Convert the nothing type to a string. |
Method |
|
Convert a function parameter to a string. |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Visit a signature, producing a string. |
Method |
|
Undocumented |
Method |
|
Convert a template to a string. |
Method |
|
Undocumented |
Method |
|
Convert the AST for an entire module back to a string. |
Method |
|
Undocumented |
Method |
|
Convert a union type ("x or y") to a string. |
Constant | INDENT |
Undocumented |
Class Variable | visits |
Undocumented |
Instance Variable | class |
Undocumented |
Instance Variable | imports |
Undocumented |
Instance Variable | in |
Undocumented |
Instance Variable | in |
Undocumented |
Instance Variable | in |
Undocumented |
Instance Variable | in |
Undocumented |
Instance Variable | in |
Undocumented |
Instance Variable | multiline |
Undocumented |
Instance Variable | old |
Undocumented |
Method | _ |
Builds a intersection of the types in type_list. |
Method | _ |
Builds a union of the types in type_list. |
Method | _ |
Undocumented |
Method | _ |
Print out the last type parameter of a container. Used for *args/**kw. |
Method | _ |
Undocumented |
Method | _ |
Form list of types within a set type. |
Method | _ |
Undocumented |
Method | _ |
Generate import statements needed by the nodes we've visited so far. |
Method | _ |
Guess which part of the given name is the module prefix. |
Method | _ |
Undocumented |
Method | _ |
Undocumented |
Method | _ |
Check if it is an empty tuple. |
Method | _ |
Undocumented |
Method | _ |
Check if it is typing.Callable type. |
Method | _ |
Do we need to use Tuple[x, ...] instead of Tuple[x]? |
Method | _ |
Undocumented |
Method | _ |
Register that we're using name from module. |
Method | _ |
Undocumented |
Method | _ |
Undocumented |
Constant | _RESERVED |
Undocumented |
Instance Variable | _alias |
Undocumented |
Instance Variable | _class |
Undocumented |
Instance Variable | _local |
Undocumented |
Instance Variable | _maybe |
Undocumented |
Instance Variable | _module |
Undocumented |
Instance Variable | _paramspec |
Undocumented |
Instance Variable | _typing |
Undocumented |
Instance Variable | _unit |
Undocumented |
Inherited from Visitor
:
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Class Variable | old |
Undocumented |
Class Variable | unchecked |
Undocumented |
Instance Variable | enter |
Undocumented |
Instance Variable | leave |
Undocumented |
Instance Variable | visit |
Undocumented |
Instance Variable | visit |
Undocumented |
Class Variable | _visitor |
Undocumented |
Builds a intersection of the types in type_list. Args: type_list: A list of strings representing types. Returns: A string representing the intersection of the types in type_list. Simplifies Intersection[X] to X and Intersection[X, None] to Optional[X].
Builds a union of the types in type_list. Args: type_list: A list of strings representing types. Returns: A string representing the union of the types in type_list. Simplifies Union[X] to X and Union[X, None] to Optional[X].
Register that we're using name from module. Args: module: string identifier. name: if None, means we want 'import module'. Otherwise string identifier that we want to import.