Comparing float and decimal

greg greg at
Fri Oct 3 08:53:41 CEST 2008

Terry Reedy wrote:

> Documenting the problem properly would mean changing the set 
> documentation ... from their current 
> math set based definitions to implementation based definitions

It could be documented that the mathematical definitions
hold only if the equality relations between all the elements
involved are transitive, and leave the semantics in other
cases undefined.

Then in the Decimal module it could be warned that the
equality relations between int-float and int-Decimal are
not transitive, perhaps noting that this can cause
problems with sets and dicts.


More information about the Python-list mailing list