Python Language Services
************************

Python provides a number of modules to assist in working with the
Python language.  These modules support tokenizing, parsing, syntax
analysis, bytecode disassembly, and various other facilities.

These modules include:

* "ast" — Abstract Syntax Trees

  * Abstract Grammar

  * Node classes

    * "AST"

      * "_fields"

      * "_field_types"

      * "lineno"

      * "col_offset"

      * "end_lineno"

      * "end_col_offset"

    * Root nodes

      * "Module"

      * "Expression"

      * "Interactive"

      * "FunctionType"

    * Literals

      * "Constant"

      * "FormattedValue"

      * "JoinedStr"

      * "List"

      * "Tuple"

      * "Set"

      * "Dict"

    * Variables

      * "Name"

      * "Load"

      * "Store"

      * "Del"

      * "Starred"

    * Expressions

      * "Expr"

      * "UnaryOp"

      * "UAdd"

      * "USub"

      * "Not"

      * "Invert"

      * "BinOp"

      * "Add"

      * "Sub"

      * "Mult"

      * "Div"

      * "FloorDiv"

      * "Mod"

      * "Pow"

      * "LShift"

      * "RShift"

      * "BitOr"

      * "BitXor"

      * "BitAnd"

      * "MatMult"

      * "BoolOp"

      * "And"

      * "Or"

      * "Compare"

      * "Eq"

      * "NotEq"

      * "Lt"

      * "LtE"

      * "Gt"

      * "GtE"

      * "Is"

      * "IsNot"

      * "In"

      * "NotIn"

      * "Call"

      * "keyword"

      * "IfExp"

      * "Attribute"

      * "NamedExpr"

      * Subscripting

        * "Subscript"

        * "Slice"

      * Comprehensions

        * "ListComp"

        * "SetComp"

        * "GeneratorExp"

        * "DictComp"

        * "comprehension"

    * Statements

      * "Assign"

        * "type_comment"

      * "AnnAssign"

      * "AugAssign"

      * "Raise"

      * "Assert"

      * "Delete"

      * "Pass"

      * "TypeAlias"

      * Imports

        * "Import"

        * "ImportFrom"

        * "alias"

    * Control flow

      * "If"

      * "For"

        * "type_comment"

      * "While"

      * "Break"

      * "Continue"

      * "Try"

      * "TryStar"

      * "ExceptHandler"

      * "With"

        * "type_comment"

      * "withitem"

    * Pattern matching

      * "Match"

      * "match_case"

      * "MatchValue"

      * "MatchSingleton"

      * "MatchSequence"

      * "MatchStar"

      * "MatchMapping"

      * "MatchClass"

      * "MatchAs"

      * "MatchOr"

    * Type parameters

      * "TypeVar"

      * "ParamSpec"

      * "TypeVarTuple"

    * Function and class definitions

      * "FunctionDef"

        * "type_comment"

      * "Lambda"

      * "arguments"

      * "arg"

        * "type_comment"

      * "Return"

      * "Yield"

      * "YieldFrom"

      * "Global"

      * "Nonlocal"

      * "ClassDef"

    * Async and await

      * "AsyncFunctionDef"

      * "Await"

      * "AsyncFor"

      * "AsyncWith"

  * "ast" Helpers

    * "parse()"

    * "unparse()"

    * "literal_eval()"

    * "get_docstring()"

    * "get_source_segment()"

    * "fix_missing_locations()"

    * "increment_lineno()"

    * "copy_location()"

    * "iter_fields()"

    * "iter_child_nodes()"

    * "walk()"

    * "NodeVisitor"

      * "visit()"

      * "generic_visit()"

      * "visit_Constant()"

    * "NodeTransformer"

    * "dump()"

  * Compiler Flags

    * "PyCF_ALLOW_TOP_LEVEL_AWAIT"

    * "PyCF_ONLY_AST"

    * "PyCF_OPTIMIZED_AST"

    * "PyCF_TYPE_COMMENTS"

  * Command-Line Usage

* "symtable" — Access to the compiler’s symbol tables

  * Generating Symbol Tables

    * "symtable()"

  * Examining Symbol Tables

    * "SymbolTableType"

      * "MODULE"

      * "FUNCTION"

      * "CLASS"

      * "ANNOTATION"

      * "TYPE_ALIAS"

      * "TYPE_PARAMETERS"

      * "TYPE_VARIABLE"

    * "SymbolTable"

      * "get_type()"

      * "get_id()"

      * "get_name()"

      * "get_lineno()"

      * "is_optimized()"

      * "is_nested()"

      * "has_children()"

      * "get_identifiers()"

      * "lookup()"

      * "get_symbols()"

      * "get_children()"

    * "Function"

      * "get_parameters()"

      * "get_locals()"

      * "get_globals()"

      * "get_nonlocals()"

      * "get_frees()"

    * "Class"

      * "get_methods()"

    * "Symbol"

      * "get_name()"

      * "is_referenced()"

      * "is_imported()"

      * "is_parameter()"

      * "is_global()"

      * "is_nonlocal()"

      * "is_declared_global()"

      * "is_local()"

      * "is_annotated()"

      * "is_free()"

      * "is_assigned()"

      * "is_namespace()"

      * "get_namespaces()"

      * "get_namespace()"

  * Command-Line Usage

* "token" — Constants used with Python parse trees

  * "tok_name"

  * "ISTERMINAL()"

  * "ISNONTERMINAL()"

  * "ISEOF()"

  * "ENDMARKER"

  * "NAME"

  * "NUMBER"

  * "STRING"

  * "NEWLINE"

  * "INDENT"

  * "DEDENT"

  * "LPAR"

  * "RPAR"

  * "LSQB"

  * "RSQB"

  * "COLON"

  * "COMMA"

  * "SEMI"

  * "PLUS"

  * "MINUS"

  * "STAR"

  * "SLASH"

  * "VBAR"

  * "AMPER"

  * "LESS"

  * "GREATER"

  * "EQUAL"

  * "DOT"

  * "PERCENT"

  * "LBRACE"

  * "RBRACE"

  * "EQEQUAL"

  * "NOTEQUAL"

  * "LESSEQUAL"

  * "GREATEREQUAL"

  * "TILDE"

  * "CIRCUMFLEX"

  * "LEFTSHIFT"

  * "RIGHTSHIFT"

  * "DOUBLESTAR"

  * "PLUSEQUAL"

  * "MINEQUAL"

  * "STAREQUAL"

  * "SLASHEQUAL"

  * "PERCENTEQUAL"

  * "AMPEREQUAL"

  * "VBAREQUAL"

  * "CIRCUMFLEXEQUAL"

  * "LEFTSHIFTEQUAL"

  * "RIGHTSHIFTEQUAL"

  * "DOUBLESTAREQUAL"

  * "DOUBLESLASH"

  * "DOUBLESLASHEQUAL"

  * "AT"

  * "ATEQUAL"

  * "RARROW"

  * "ELLIPSIS"

  * "COLONEQUAL"

  * "EXCLAMATION"

  * "OP"

  * "TYPE_IGNORE"

  * "TYPE_COMMENT"

  * "SOFT_KEYWORD"

  * "FSTRING_START"

  * "FSTRING_MIDDLE"

  * "FSTRING_END"

  * "COMMENT"

  * "NL"

  * "ERRORTOKEN"

  * "N_TOKENS"

  * "NT_OFFSET"

  * "ENCODING"

  * "EXACT_TOKEN_TYPES"

* "keyword" — Testing for Python keywords

  * "iskeyword()"

  * "kwlist"

  * "issoftkeyword()"

  * "softkwlist"

* "tokenize" — Tokenizer for Python source

  * Tokenizing Input

    * "tokenize()"

    * "generate_tokens()"

    * "untokenize()"

    * "detect_encoding()"

    * "open()"

    * "TokenError"

  * Command-Line Usage

  * Examples

* "tabnanny" — Detection of ambiguous indentation

  * "check()"

  * "verbose"

  * "filename_only"

  * "NannyNag"

  * "process_tokens()"

* "pyclbr" — Python module browser support

  * "readmodule()"

  * "readmodule_ex()"

  * Function Objects

    * "Function"

      * "file"

      * "module"

      * "name"

      * "lineno"

      * "parent"

      * "children"

      * "is_async"

  * Class Objects

    * "Class"

      * "file"

      * "module"

      * "name"

      * "lineno"

      * "parent"

      * "children"

      * "super"

      * "methods"

* "py_compile" — Compile Python source files

  * "PyCompileError"

  * "compile()"

  * "PycInvalidationMode"

    * "TIMESTAMP"

    * "CHECKED_HASH"

    * "UNCHECKED_HASH"

  * Command-Line Interface

* "compileall" — Byte-compile Python libraries

  * Command-line use

  * Public functions

    * "compile_dir()"

    * "compile_file()"

    * "compile_path()"

* "dis" — Disassembler for Python bytecode

  * Command-line interface

  * Bytecode analysis

    * "Bytecode"

      * "from_traceback()"

      * "codeobj"

      * "first_line"

      * "dis()"

      * "info()"

  * Analysis functions

    * "code_info()"

    * "show_code()"

    * "dis()"

    * "disassemble()"

    * "get_instructions()"

    * "findlinestarts()"

    * "findlabels()"

    * "stack_effect()"

  * Python Bytecode Instructions

    * "Instruction"

      * "opcode"

      * "opname"

      * "baseopcode"

      * "baseopname"

      * "arg"

      * "oparg"

      * "argval"

      * "argrepr"

      * "offset"

      * "start_offset"

      * "cache_offset"

      * "end_offset"

      * "starts_line"

      * "line_number"

      * "is_jump_target"

      * "jump_target"

      * "positions"

    * "Positions"

      * "lineno"

      * "end_lineno"

      * "col_offset"

      * "end_col_offset"

  * Opcode collections

    * "opname"

    * "opmap"

    * "cmp_op"

    * "hasarg"

    * "hasconst"

    * "hasfree"

    * "hasname"

    * "hasjump"

    * "haslocal"

    * "hascompare"

    * "hasexc"

    * "hasjrel"

    * "hasjabs"

* "pickletools" — Tools for pickle developers

  * Command line usage

    * Command line options

  * Programmatic Interface

    * "dis()"

    * "genops()"

    * "optimize()"
