I guess you want to add parentheses, and an `assert`. `a == b is c` means `(a == b) and (b is c)`.

But actually, you should just use `assert hash(...) == hash(...)`. There is no reason to complicate matters.