Mark Dickinson <dicki...@gmail.com> added the comment: Making float <-> Decimal comparisons return the 'right' answer in 2.x does look attractive at first sight, but the more I think about it the more it seems a bad idea. Having the comparisons work in 2.x but not in 3.x seems especially nasty, and allowing mixed-type comparisons but not mixed-type arithmetic operations also seems somehow unclean. So -1 from me. (And no, I don't want to add full float <-> Decimal interaction: the Decimal module is quite complicated enough as it is.)
Are there many cases where float <-> Decimal comparisons are useful? The only uses I can think of would also involve a need for mixed-type arithmetic. In the few cases where it's really needed I don't think it's a problem to explicitly convert one or the other type. The current bogus comparison results also suck, but they're just one aspect of a known Python 2.x gotcha. Would it be possible to raise a warning for Decimal <-> float comparisons? Does -3 already do this? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2531> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com