A static type analyzer for Python code
Home
Developer guide
Workflow
• Development process
• Python version upgrades
• Supporting new features
Program analysis
• Bytecode
• Directives
• Main loop
• Stack frames
• Typegraph
Data representation
• Abstract values
• Attributes
• Overlays
• Special builtins
• Type annotations
• Type stubs
• TypeVars
Configuration
Style guide
Tools
Documentation debugging
View the Project on GitHub google/pytype
Hosted on GitHub Pages — Theme by orderedlist
This is a living document in which pytype coding best practices will be documented.
foo_var
) or annotated
(foo: cfg.Variable
) to make their types obvious.abstract_utils.get_atomic_value
or
abstract_utils.get_atomic_python_constant
to unwrap variables that contain a
single value, unless you have a specific reason not to. Other options, like
value = var.data[0]
or value, = var.data
, silently discard data or produce
unclear error messages.