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.ResolvedFileSpan¶
-
- span¶
A
ResolvedSpan
.
- class starlark.ResolvedSpan¶
- begin¶
A
ResolvedPos
.
- end¶
A
ResolvedPos
.
Diagnostics¶
- exception starlark.StarlarkError¶
Dialect¶
- class starlark.Dialect¶
-
- enable_types¶
A value of type
DialectTypes
.
Note
These attributes are only writable (not readable) for the moment.
AST¶
Globals¶
Modules¶
- class starlark.Module¶
–
- __getitem__(key, /)¶
Return self[key].
- __setitem__(key, value, /)¶
Set self[key] to value.
- freeze()¶
- class starlark.FrozenModule¶
Loaders¶
- class starlark.FileLoader(load_func: Callable[[str], FrozenModule])¶
–
Parsing and Evaluation¶
- starlark.parse(filename, content, dialect=None)¶
Parse Starlark source code as a string and return an AST.
- starlark.eval(module, ast, globals, file_loader=None)¶
Note that this consumes the ast argument, which is unusable after being passed to this fucntion.
- Returns:
the value returned by the evaluation, after Object conversion.