Skip to main content

Module python

Module python 

Source
Expand description

Structural extraction for Python.

Python scopes by indentation rather than braces, so the walk tracks the column a declaration was written at and closes it when a later declaration appears at the same column or further left. Working from token columns rather than raw line prefixes keeps this correct inside triple-quoted strings, where a line that looks like def x(): is text, not code.

Functionsยง

extract
Extracts structural facts from one Python source.