The hash of -1 is equal to the hash of -2 in python
For some reason the hash of the negative integers -1 and -2 is the same. Is this a bug? >>> hash(-1) -2 >>> hash(-2) -2 >Solution : No, it’s not a bug, as stated in the help text of the hash function: >>> help(hash) Help on built-in function hash in module builtins: hash(obj, /) Return… Read More The hash of -1 is equal to the hash of -2 in python