[Python-Dev] Decimal <-> float comparisons in py3k.

Adam Olsen rhamph at gmail.com
Fri Mar 19 16:22:12 CET 2010

On Thu, Mar 18, 2010 at 12:41, Mark Dickinson <dickinsm at gmail.com> wrote:
> I'm only seeing two arguments against this at the moment: (1) it has
> the potential to break code that relies on being able to sort
> heterogeneous lists.  But given that heterogeneous lists can't be
> sorted stably anyway (see my earlier post about lists containing ints,
> floats and Decimals), perhaps this is an acceptable risk. (2) A few of
> the posters here (Steven, Nick, and me) feel that it's slightly more
> natural to allow these comparisons;  but I think the argument's fairly
> evenly balanced at the moment between those who'd prefer an exception
> and those who'd prefer to allow the comparisons.

Conceptually I like the idea of them all being comparable, but are
there any real use cases involving heterogeneous lists?  All the
examples I've seen have focused on how they're broken, not on how
they'd be correct (including possible math after the comparison!) if
the language compared properly.

Without such use cases allowing comparison seems like a lot of work for nothing.

Adam Olsen, aka Rhamphoryncus

More information about the Python-Dev mailing list