On 14 February 2014 18:04, Chris Withers <chris at simplistix.co.uk> wrote: > > Am I missing something? How can I get this method down to a sane size? The easiest way is usually to normalise the attributes to a sensible numeric value depending on where you want "None" to sort (positive and negative infinity floating point values often work well in the case of numeric data, but a custom AlwaysLess or AlwaysGreater type works for arbitrary data). You can either do that dynamically, or else cache the normalised values when the attributes are set. Python 2 used to guess, Python 3 makes developers decide how they want None to be handled in the context of ordering operations. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
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