Meta

Meta is an important object that is used to keep track of our position in the original val when we are normalising it.

class input_algorithms.meta.Meta(everything, path)

Meta has a concept of the wider context, kept as the everything property , and the path into everything where we are.

We move around the everything by creating new instances of Meta that refers to a new part: using the methods on the meta object.

Arguments
everything

The wider context

path

Can be given as a string or a list of tuples.

If provided as a string, it is converted to [(path, "")]

Usage
at(val)

Return a new instance with (path, "") added to the path

indexed_at(index)

Return a new instance with ("", "[index]") added to the path

key_names()

Return {_key_name_<i>: <i’th part of part} for each part in the path reversed

Useful
__eq__(other)

Wortk out if we have the same everything and path

__lt__(other)

Work out if the str(everything) < str(other.everything) and path < other.path.

__gt__(other)

Work out if we are not equal or less than other

Path
path()

Return the path as a string

nonspecial_path()

Return the path as a string without extra strings

source()

Return the source path of this value by asking everything for the source of this path