-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
Description
Describe the bug
Hash function does not respect object equality.
To Reproduce
Steps to reproduce the behavior:
import islpy
a = islpy.MultiAff("{ [i] -> [i] }")
b = islpy.MultiAff("{ [j] -> [j] }")
print(a == b) # prints "True"
print(hash(a) == hash(b)) # prints "False"Expected behavior
I expect the hash function to be equal when the objects are equal.
Environment (please complete the following information):
- OS: MacOS
- Python version: 3.8
My Observations
It seems like the islpy wrapper is requires a <obj>_get_hash function in ISL to work properly, or else will fall back to a hash of the string: https://github.com/inducer/islpy/blob/main/islpy/__init__.py#L323. I believe those get_hash functions do not go through the wrapper script for some reason.