Message83816
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? |
|
Date |
User |
Action |
Args |
2009-03-19 18:01:34 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, facundobatista, jdunck, lorg |
2009-03-19 18:01:34 | mark.dickinson | set | messageid: <1237485694.09.0.242137072408.issue2531@psf.upfronthosting.co.za> |
2009-03-19 18:01:32 | mark.dickinson | link | issue2531 messages |
2009-03-19 18:01:31 | mark.dickinson | create | |
|