A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-February/132457.html below:

[Python-Dev] python 3 niggle: None < 1 raises TypeError

[Python-Dev] python 3 niggle: None < 1 raises TypeError [Python-Dev] python 3 niggle: None < 1 raises TypeErrorTerry Reedy tjreedy at udel.edu
Tue Feb 18 16:53:33 CET 2014
On 2/18/2014 2:35 AM, Greg Ewing wrote:

>    results = sorted(invoices, key=attrgetter('duedate'), none='first')

I think this is the best idea on the thread. As a pure enhancement, it 
could be added in 3.5. The only tricky part of the implementation is 
maintaining stability of the sort. The obvious implementation of 
swapping Nones with objects at one end would break that. Instead, a scan 
listing the positions of Nones should be followed by a series of block 
moves of objects (pointers) between the Nones. It would still be O(n).

-- 
Terry Jan Reedy

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4