Re: [Mesa-dev] [PATCH 21/26] python: Use key-functions when sorting containers

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 09:38:19 -0700, Dylan Baker wrote: > Quoting Mathieu Bridon (2018-07-05 06:17:52) > > In Python 2, the traditional way to sort containers was to use a > > comparison function (which returned either -1, 0 or 1 when passed two > > objects) and pass that as the "cmp" argument t

Re: [Mesa-dev] [PATCH 21/26] python: Use key-functions when sorting containers

2018-07-05 Thread Dylan Baker
Quoting Mathieu Bridon (2018-07-05 06:17:52) > In Python 2, the traditional way to sort containers was to use a > comparison function (which returned either -1, 0 or 1 when passed two > objects) and pass that as the "cmp" argument to the container's sort() > method. > > Python 2.4 introduced key-f

[Mesa-dev] [PATCH 21/26] python: Use key-functions when sorting containers

2018-07-05 Thread Mathieu Bridon
In Python 2, the traditional way to sort containers was to use a comparison function (which returned either -1, 0 or 1 when passed two objects) and pass that as the "cmp" argument to the container's sort() method. Python 2.4 introduced key-functions, which instead only operate on a given item, and