[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > At this stage of the Py3 life cycle, though, > it seems simpler overall to remain consistent > with earlier Py3 releases. Given that so few users have converted, it is simpler to become consistent with Py2.7 and to not introduce compensating features. ---

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Nick Coghlan
Nick Coghlan added the comment: I suspect if we'd thought of it back in the 3.0 or 3.1 time frame then giving the Py3 None a consistent "sorts low" behaviour would have been more likely. At this stage of the Py3 life cycle, though, it seems simpler overall to remain consistent with earlier Py3 r

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > If it is in fact specific to sorting, then this specific symptom > and "the problem" are in fact the same thing ;-) The first rule of tautology club is the first rule of tautology club ;-) FWIW, we had to add a work-around for this in pprint._safe_key clas

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Nick Coghlan
Nick Coghlan added the comment: And in case that last comment worried anyone - I won't commit *anything* related to this to the standard library until after creating a PyPI "sortlib" module that includes both this and an "order_by_key" class decorator, and we have consensus that the proposed chan

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Nick Coghlan
Nick Coghlan added the comment: It occurred to me the current names are a bit misleading when using "reverse=True", so low/high is likely a better naming scheme than first/last. I think I'll propose a patch for six before doing anything to the standard library - this is already an issue for some

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Both Nick's proposals look ok to me. -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list ma

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Tim Peters
Tim Peters added the comment: I've haven't yet seen anyone complain about the inability to compare None except in the specific context of sorting. If it is in fact specific to sorting, then this specific symptom and "the problem" are in fact the same thing ;-) -- nosy: +tim.peters _

[issue20630] Add sorting helpers for collections containing None values

2014-02-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Currently, it's a bit annoying to sort collections > containing "None" values in Python 3 I think we should seriously consider whether to restore None's ability to compare with other entries. Removing this capability has been a major PITA and is an obs

[issue20630] Add sorting helpers for collections containing None values

2014-02-21 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue20630] Add sorting helpers for collections containing None values

2014-02-14 Thread Nick Coghlan
New submission from Nick Coghlan: Currently, it's a bit annoying to sort collections containing "None" values in Python 3. While the default behaviour isn't going to change, it would be good to offer standard "none_first" and "none_last" helps (inspired by the SQL NULL FIRST and NULL LAST orde