knit_script.knit_script_interpreter.scope.variable_space module
Module containing the Variable_Space class.
- class Variable_Space[source]
Bases:
objectTracks all the variables in a local scope with no protected attributes to accidentally override.
- __getitem__(variable_name)[source]
- Parameters:
variable_name (str) – The name of the variable to access.
- Returns:
The value of the variable.
- Return type:
Any
- Raises:
AttributeError – If the variable does not exist.
- __setitem__(variable_name, value)[source]
Set a variable with the given variable name. Overrides any variable already defined by that variable name.
- Parameters:
variable_name (str) – The name of the variable to set.
value (Any) – The value of the variable.
- __delitem__(variable_name)[source]
Delete the variable with the given key name.
- Parameters:
variable_name (str) – The name of the variable to delete.
- Raises:
AttributeError – If the variable does not exist.