module documentation

Library to take a Python AST and add Pytype type information to it.

Class AnnotateAstVisitor Traverses an AST and sets type information on its nodes.
Exception PytypeError Wrap exceptions raised by Pytype.
Function annotate_source Infer types for `source`, and return an AST of it with types added.
Function infer_types Infer types for the provided source.
Function _annotation_str_from_type_def Undocumented
def annotate_source(source, ast_module, pytype_options): (source)

Infer types for `source`, and return an AST of it with types added. Args: source: Text, the source code to type-infer and parse to an AST. ast_module: An ast-module like object used to parse the source to an AST and traverse the created ast.Module object. pytype_options: pytype.config.Options, the options to pass onto Pytype. Returns: The created Module object from what `ast_factory` returned.

def infer_types(source, options): (source)

Infer types for the provided source. Args: source: Text, the source code to analyze. options: pytype.config.Options, the options to pass onto Pytype. Returns: source.Code object with information gathered by Pytype.

def _annotation_str_from_type_def(type_def): (source)

Undocumented