Format: application/octet-stream
⬇ Download File (1.2 KB)
   1  # Python 2.7 ast
   2  
   3  # Rename typing to _typing, as not to conflict with typing imported
   4  # from _ast below when loaded in an unorthodox way by the Dropbox
   5  # internal Bazel integration.
   6  import typing as _typing
   7  from typing import Any, Iterator, Optional, Union
   8  
   9  from _ast import *
  10  from _ast import AST, Module
  11  
  12  def parse(source: Union[str, unicode], filename: Union[str, unicode] = ..., mode: Union[str, unicode] = ...) -> Module: ...
  13  def copy_location(new_node: AST, old_node: AST) -> AST: ...
  14  def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
  15  def fix_missing_locations(node: AST) -> AST: ...
  16  def get_docstring(node: AST, clean: bool = ...) -> str: ...
  17  def increment_lineno(node: AST, n: int = ...) -> AST: ...
  18  def iter_child_nodes(node: AST) -> Iterator[AST]: ...
  19  def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ...
  20  def literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ...
  21  def walk(node: AST) -> Iterator[AST]: ...
  22  
  23  class NodeVisitor:
  24      def visit(self, node: AST) -> Any: ...
  25      def generic_visit(self, node: AST) -> Any: ...
  26  
  27  class NodeTransformer(NodeVisitor):
  28      def generic_visit(self, node: AST) -> Optional[AST]: ...
  29