[issue35956] Sort documentation could be improved for complex sorting

2019-02-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyt

[issue35956] Sort documentation could be improved for complex sorting

2019-02-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: It seems to me that the sorting howto covers this topic. If I'm reading the OP's task correctly, it isn't complex at all: points.sort(key=attrgetter('x', 'y')) # x is primary key; y is secondary -- assignee: docs@python -> rhettinger nosy: +rh

[issue35956] Sort documentation could be improved for complex sorting

2019-02-10 Thread Cheryl Sabella
Cheryl Sabella added the comment: Take a look at issue 35020 which discusses multisort. -- nosy: +cheryl.sabella ___ Python tracker ___ ___

[issue35956] Sort documentation could be improved for complex sorting

2019-02-10 Thread SilentGhost
SilentGhost added the comment: Is this not equivalent to the following? sorted(points, key=lambda p: (p.y, p.x)) -- nosy: +SilentGhost ___ Python tracker ___ __

[issue35956] Sort documentation could be improved for complex sorting

2019-02-10 Thread fabrice salvaire
New submission from fabrice salvaire : I just implemented Graham Scan algorithm in Python 3 and have to read carefully the sort documentation. Notice this is a good algorithm for a large audience language like Python. Since Python 3, the old order function cmp is depicted as an old way to pr