Message74586
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 opened a separate
set documentation issue http://bugs.python.org/issue4090
leaving this as a Decimal-other_number equality issue.
The root of the problem is that all members of s are members of t and
vice versa. This should make s and t equal, but they are not. This
also breaks the definitions of issubset (<=), issuperset (>=), union
(|), and symmetric_difference (^) as shown in the c.l.p thread.
Transitivity is also fundamental in logic and the rule of substitution.
So I strongly prefer that it be preserved in Python as released.
Another way to restore transitivity is
(4) make Decimal(1) != int(1) just as Decimal(1) != float(1). Having a
Decimal be equal in value to just one of two things that are equal in
value is incoherent, and leads to incoherent results. |
|
Date |
User |
Action |
Args |
2008-10-09 16:45:10 | terry.reedy | set | recipients:
+ terry.reedy, rhettinger, facundobatista, mark.dickinson |
2008-10-09 16:45:10 | terry.reedy | set | messageid: <1223570710.43.0.388584196256.issue4087@psf.upfronthosting.co.za> |
2008-10-09 16:45:09 | terry.reedy | link | issue4087 messages |
2008-10-09 16:45:09 | terry.reedy | create | |
|