-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hashing for IR Nodes #119
Comments
Hi @bifunctor , Good point! Never really thought about it, but it might be convenient to make the So in short: no specific reason, just never thought about it. |
tl;dr: Its a good idea to implement I believe that support should be added for class Block:
...
def __hash__(self):
assert self.function, "function should have been set"
return hash((self.name, self.function)) or if you wish to be able to compare blocks without having added them to functions: class Block:
...
def __hash__(self):
return hash(self.name) and so on. |
Hello, I'm quite new to PPCI. While I was looking in
ir.py
, I was wondering why the nodes don't have__eq__
of__hash__
implemented in them. Is there a reason behine this? Maybe a way to get around it? Thanks!The text was updated successfully, but these errors were encountered: