Comparing float and decimal

greg greg at cosc.canterbury.ac.nz
Fri Oct 3 02:53:41 EDT 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.

-- 
Greg



More information about the Python-list mailing list