◐ Shell
clean mode source ↗

Message 390698 - Python tracker

Mark, is there any reason hash(float('NaN')) and hash(Decimal('NaN')) have to be a constant?  Since NaNs don't compare equal, the hash homomorphism has no restrictions.  Why not have hash() return the id() like we do for instances of object?

I understand that sys.hash_info.nan would be invalidated, but that was likely useless anyway.