[issue26751] Possible bug in sorting algorithm

2016-04-16 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> not a bug status: open -> closed ___ Python tracker ___

[issue26751] Possible bug in sorting algorithm

2016-04-13 Thread Tim Peters
Tim Peters added the comment: If that's the actual code you're using, it has a bug: the "if k2[1] is None" test is useless, since regardless of whether it's true or false, the next `if` suite overwrites `retval`. You probably meant elif k1[1] ... ^^ instead of if k1[1] ...

[issue26751] Possible bug in sorting algorithm

2016-04-13 Thread David Manowitz
New submission from David Manowitz: I'm trying to sort a list of tuples. Most of the tuples are pairs of US state names. However, some of the tuples have None instead of the 2nd name. I want the items sorted first by the 1st element, and then by the 2nd element, BUT I want the None to