This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients facundobatista, mark.dickinson, rhettinger, terry.reedy
Date 2008-10-09.16:45:09
SpamBayes Score 5.453155e-09
Marked as misclassified No
Message-id <1223570710.43.0.388584196256.issue4087@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-10-09 16:45:10terry.reedysetrecipients: + terry.reedy, rhettinger, facundobatista, mark.dickinson
2008-10-09 16:45:10terry.reedysetmessageid: <1223570710.43.0.388584196256.issue4087@psf.upfronthosting.co.za>
2008-10-09 16:45:09terry.reedylinkissue4087 messages
2008-10-09 16:45:09terry.reedycreate