Python 3.0 - is this true?

Rhamphoryncus rhamph at gmail.com
Mon Nov 10 23:31:25 EST 2008


On Nov 10, 6:25 pm, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:
> On Mon, 10 Nov 2008 11:43:59 -0800, Rhamphoryncus wrote:
> > You might as well comment out the sort and call it good.  That's what
> > you really had in 2.x.  It was close enough most of the time to *look*
> > right, yet in truth it silently failed.  3.0 makes it an explicit
> > failure.
>
> I don't doubt that this is correct, but I think the argument that sorting
> in Python 2.x has silent bugs would be much stronger if somebody could
> demonstrate arrays that sort wrongly.
>
> A shiny wooden nickel for the first person to show such an example!
>
> --
> Steven

>>> sorted([2, 1.5, Decimal('1.6'), 2.7, 2])
[1.5, 2.7000000000000002, Decimal("1.6"), 2, 2]

Where's my nickel? :P



More information about the Python-list mailing list