New submission from Mark Dickinson [EMAIL PROTECTED]:
The Decimal module breaks transitivity of equality: Decimal(2) == 2 and
2 == float(2), but Decimal(2) != float(2).
The Python set and dict implementations rely on transitivity of equality
for correct operation.
These two facts together
Terry J. Reedy [EMAIL PROTECTED] added the comment:
There are two issues involved:
1. documenting set behavior
2. what to do, if anything, about Decimals and other numbers
Since users are free to create similar problems, and since sets are
missing from the Reference section on comparisons, I
Facundo Batista [EMAIL PROTECTED] added the comment:
(Ok, remember that I'm not a numeric guy before start hitting me, :p )
I think that if we have Decimal(1)==1, and 1==1.0, to have Decimal(1)==1.0.
We always rejected comparison with unsupported types, but having this
situation, I'd propose