class documentation

The basic class to store and handle symbols, lists, and values in the Interpreter.

Class Method symbolFromValue Create a new SSymbol object from a value.
Method __contains__ Check whether an object is contained within the value.
Method __eq__ Check whether two SSymbol objects are equal.
Method __getitem__ Return an element or a slice from a list, or a character from a string.
Method __gt__ Check whether the value is greater than another value.
Method __init__ Initialization of a SSymbol object or one of its sub-classes.
Method __len__ Return the length of the value.
Method __lt__ Check whether the value is less than another value.
Method __repr__ Nicely printable version of value.
Method __str__ Nicely printable version of value.
Method printHierarchy Print the hierarchy in reverse order (parent first) with reversed indentation.
Method raw The Python "raw" value.
Method toString Return a string representation of the value.
Class Variable __slots__ Slots of class attributes.
Instance Variable length The length of the symbol. Could be the length of a string, number of items in a list etc.
Instance Variable parent Parent SSymbol object.
Instance Variable type SType to indicate the type.
Instance Variable value The actual stored value. This is either one of the the basic data typs, of a SSymbol, list of SSymbol, dictionary, etc.
@classmethod
def symbolFromValue(cls, value: bool | str | int | float | list | dict) -> SSymbol:

Create a new SSymbol object from a value.

Parameters
value:bool | str | int | float | list | dictA value that is then automatically assigned to one of the basic, quoted types.
Returns
SSymbolA new SSymbol sub-class object.
def __contains__(self, obj: Any) -> bool:

Check whether an object is contained within the value.

This works for characters and strings, and elements and lists.

Parameters
obj:AnyObject to check.
Returns
boolTrue if the object is contained, False otherwise.
def __eq__(self, other: Any) -> bool:

Check whether two SSymbol objects are equal.

Parameters
other:AnyThe other object to compare.
Returns
boolTrue if the two objects are equal, False otherwise.
def __getitem__(self, key: int | slice) -> Any:

Return an element or a slice from a list, or a character from a string.

Parameters
key:int | sliceEither an number or a slice.
Returns
AnyA single element or a sice of elements if value is a list, or a single or multiple characters if value is a string.
def __gt__(self, other: Any) -> bool:

Check whether the value is greater than another value.

Parameters
other:AnyThe other object to compare.
Returns
boolTrue if the value is greater, False otherwise.
def __len__(self) -> int:

Return the length of the value.

Returns
intLength of the value.
def __lt__(self, other: Any) -> bool:

Check whether the value is less than another value.

Parameters
other:AnyThe other object to compare.
Returns
boolTrue if the value is less, False otherwise.
def __repr__(self) -> str:

Nicely printable version of value.

Returns
strString representation.
def __str__(self) -> str:

Nicely printable version of value.

Returns
strString representation.
def printHierarchy(self, depth: int = 0, max_depth: int = None) -> str:

Print the hierarchy in reverse order (parent first) with reversed indentation.

Parameters
depth:intCurrent depth level.
max_depth:intMaximum depth level.
Returns
strParent hierarchy as a string.
def raw(self) -> Any:

The Python "raw" value.

Returns
AnyThe raw value. For types that could not be converted directly the stringified version is returned.
def toString(self, quoteStrings: bool = False, pythonList: bool = False) -> str:
__slots__: tuple[str, ...] =

Slots of class attributes.

parent: SSymbol | None =

Parent SSymbol object.

type: SType =

SType to indicate the type.