metadsl.normalized
Normalized expressions, for deduping and single replacements.
Functions
|
|
|
Computes some hash for a value that should be stable. |
Classes
|
|
|
This is a data structure that holds onto a graph of expression and has a pointer to one node, to represent it. |
|
Graph of all expression |
- class metadsl.normalized.ExpressionReference(_graph, _optional_index)[source]
This is a data structure that holds onto a graph of expression and has a pointer to one node, to represent it.
- property children: metadsl.normalized.Children
Returns the direct children of this node if it has any.
- Return type
- property descendents: Iterable[metadsl.normalized.ExpressionReference]
Returns all nodes of this expression reference. If any of them get their expression replaced, it will replace that sub-node of this expression.
If this is the root node, will return them in topo order, otherwise will be arbitrary
- Return type
- metadsl.normalized.Hash(x)
- metadsl.normalized.hash_value(value)[source]
Computes some hash for a value that should be stable. Either use the built in hash, or if we cannot (like the object is mutable) then use the id.
It’s a single dispatch function so that you can register custom hashes for objects you don’t control.
- Return type