pystencils.backend.ast.util.AstEqWrapper#
- class pystencils.backend.ast.util.AstEqWrapper(node)#
Wrapper around AST nodes that computes a hash from the AST’s textual representation and maps the
__eq__
method ontostructurally_equal
.Useful in dictionaries when the goal is to keep track of subtrees according to their structure, e.g. in elimination of constants or common subexpressions.
- Parameters:
node (PsAstNode)
Methods
__init__
(node)Attributes
n