[Python-Dev] Decimal data type issues
Batista, Facundo
FBatista at uniFON.com.ar
Tue Apr 13 14:10:33 EDT 2004
[Michael Hudson]
#- > Should the following be true?::
#- >
#- > hash(Decimal(25) == hash(25)
#- > hash(Decimal.from_float(25.35) == hash(25.35)
#- > hash(Decimal('-33.8')) == hash(-33.8)
#-
#- Well, if Decimal(25) == 25, they'd better hash the same! If
#- not, then
#- what's the point?
Remember that you only can compare Decimal to ints or long, not float nor
string.
So, This way, hash() must *only* return the same value than the equivalent
integer.
I'm ok with this.
. Facundo
More information about the Python-Dev
mailing list