Skip to content
Snippets Groups Projects
Commit 3018c3a0 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Add constant primitive.

parent 40c30be5
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,22 @@ class Leaf(AlgebraicLeaf):
class Constant(Leaf):
def __init__(self, value):
self.value = value
def __getinitargs__(self):
return self.value,
def __hash__(self):
return 0x493120aa ^ hash(self.name)
def get_mapper_method(self, mapper):
return mapper.map_constant
class Variable(Leaf):
def __init__(self, name):
self.name = name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment