Author mark.dickinson
Recipients facundobatista, jdunck, lorg, mark.dickinson, rhettinger
Date 2009-03-19.18:01:30
SpamBayes Score 3.33693e-10
Marked as misclassified No
Message-id <1237485694.09.0.242137072408.issue2531@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2009-03-19 18:01:34mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, facundobatista, jdunck, lorg
2009-03-19 18:01:34mark.dickinsonsetmessageid: <1237485694.09.0.242137072408.issue2531@psf.upfronthosting.co.za>
2009-03-19 18:01:32mark.dickinsonlinkissue2531 messages
2009-03-19 18:01:31mark.dickinsoncreate