mirror of
https://github.com/micropython/micropython.git
synced 2026-01-27 06:10:22 +01:00
Hashing of float and complex numbers that are exact (real) integers should return the same integer hash value as hashing the corresponding integer value. Eg hash(1), hash(1.0) and hash(1+0j) should all be the same (this is how Python is specified: if x==y then hash(x)==hash(y)). This patch implements the simplest way of doing float/complex hashing by just converting the value to int and returning that value.
9.0 KiB
9.0 KiB