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 facundobatista
Recipients facundobatista, mark.dickinson, rhettinger, terry.reedy
Date 2008-10-09.17:05:04
SpamBayes Score 7.728543e-05
Marked as misclassified No
Message-id <1223571906.4.0.244882588374.issue4087@psf.upfronthosting.co.za>
In-reply-to
Content
(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 to put something like the following at the
beggining of __eq__() and similars:

    def __eq__(self, other):
        if isinstance(other, float) and int(other)==other:
            other = int(other)

What do you think?
History
Date User Action Args
2008-10-09 17:05:06facundobatistasetrecipients: + facundobatista, rhettinger, terry.reedy, mark.dickinson
2008-10-09 17:05:06facundobatistasetmessageid: <1223571906.4.0.244882588374.issue4087@psf.upfronthosting.co.za>
2008-10-09 17:05:05facundobatistalinkissue4087 messages
2008-10-09 17:05:05facundobatistacreate