From d4242e16c5dfc74b66b0a0adcd1a24f2ef11315b Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Thu, 5 Nov 2015 16:28:02 +0000 Subject: [PATCH] add __hash__ to AstRef AstRef objects needs to be hashable in order to be used as keys in python dictionaries --- src/api/python/z3.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/python/z3.py b/src/api/python/z3.py index 5763db916..84fd7b111 100644 --- a/src/api/python/z3.py +++ b/src/api/python/z3.py @@ -284,6 +284,9 @@ class AstRef(Z3PPObject): def __repr__(self): return obj_to_string(self) + def __hash__(self): + return self.hash() + def sexpr(self): """Return an string representing the AST node in s-expression notation.