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- Root nodes
- Literals
- Variables
- Expressions
- Statements
- Control flow
- Pattern matching
- Type parameters
- Function and class definitions
- Async and await
astHelpers- Compiler Flags
- Command-Line Usage
symtable— Access to the compiler’s symbol tablestoken— Constants used with Python parse treestok_nameISTERMINAL()ISNONTERMINAL()ISEOF()ENDMARKERNAMENUMBERSTRINGNEWLINEINDENTDEDENTLPARRPARLSQBRSQBCOLONCOMMASEMIPLUSMINUSSTARSLASHVBARAMPERLESSGREATEREQUALDOTPERCENTLBRACERBRACEEQEQUALNOTEQUALLESSEQUALGREATEREQUALTILDECIRCUMFLEXLEFTSHIFTRIGHTSHIFTDOUBLESTARPLUSEQUALMINEQUALSTAREQUALSLASHEQUALPERCENTEQUALAMPEREQUALVBAREQUALCIRCUMFLEXEQUALLEFTSHIFTEQUALRIGHTSHIFTEQUALDOUBLESTAREQUALDOUBLESLASHDOUBLESLASHEQUALATATEQUALRARROWELLIPSISCOLONEQUALEXCLAMATIONOPTYPE_IGNORETYPE_COMMENTSOFT_KEYWORDFSTRING_STARTFSTRING_MIDDLEFSTRING_ENDCOMMENTNLERRORTOKENN_TOKENSNT_OFFSETENCODING
keyword— Testing for Python keywordstokenize— Tokenizer for Python sourcetabnanny— Detection of ambiguous indentationpyclbr— Python module browser supportpy_compile— Compile Python source filescompileall— Byte-compile Python librariesdis— Disassembler for Python bytecode- Bytecode analysis
- Analysis functions
- Python Bytecode Instructions
InstructionInstruction.opcodeInstruction.opnameInstruction.baseopcodeInstruction.baseopnameInstruction.argInstruction.opargInstruction.argvalInstruction.argreprInstruction.offsetInstruction.start_offsetInstruction.cache_offsetInstruction.end_offsetInstruction.starts_lineInstruction.is_jump_targetInstruction.jump_targetInstruction.positions
Positions
- Opcode collections
pickletools— Tools for pickle developers