Reference¶
Object conversion¶
To convert values between starlark and Python, JSON is currently being used as an intermediate format, which defines the scope of what is convertible. This, however, is subject to change.
References to Source Locations¶
- class starlark.ResolvedSpan¶
- begin¶
A
ResolvedPos
.
- end¶
A
ResolvedPos
.
Diagnostics¶
- exception starlark.StarlarkError¶
- class starlark.Lint¶
- __str__()¶
Return str(self).
- resolved_location¶
- severity¶
A
EvalSeverity
.
Dialect¶
- class starlark.Dialect¶
-
- enable_types¶
A value of type
DialectTypes
.
Note
These attributes are only writable (not readable) for the moment.
Type checking¶
- class starlark.Interface¶
Opaque for now.
AST¶
Globals¶
Modules¶
- class starlark.Module¶
–
- __getitem__(key, /)¶
Return self[key].
- __setitem__(key, value, /)¶
Set self[key] to value.
- freeze() FrozenModule ¶
–
- class starlark.FrozenModule¶
Loaders¶
- class starlark.FileLoader(load_func: Callable[[str], FrozenModule])¶
–
Parsing and Evaluation¶
- starlark.parse(filename: str, content: str, dialect: Dialect | None = None) AstModule ¶
–
Parse Starlark source code as a string and return an AST.
- starlark.eval(module: Module, ast: AstModule, globals: Globals, file_loader: FileLoader | None = None) object ¶
–
- Returns:
the value returned by the evaluation, after Object conversion.