On Tuesday 14 October 2003 04:46 pm, Guido van Rossum wrote: ... > I'm not sure whether the defaults should cater to the extreme > performance cases or to the smaller cases; I expect that the latter > are more common, and people who are sorting truly huge lists should > read the manual if they care about performance. But that's just me. I think your general philosophy on "defaults cover normal cases" is part of what makes Python so good, so, if it's just you, that need not be a bad thing;-). However, it seems to me that, in a normal case (sorting a smallish number of easily comparable thingies), whether the indices are or are not added to the decoration is not going to make an enormous difference either way. So, maybe we should focus on two slightly less normal cases where performance or correctness may be impacted: -- if we're sorting a huge list of easily comparable thingies then the overhead of adding so many indices to the decoration might hurt -- if we're sorting a list of expensive-to-compare thingies (e.g. dicts) or non-comparable thingies, the indices (or something, but might as well be the indices, it seems to me) are needed in the decoration (except in the special cases where all keys can be guaranteed to differ, of course) -- whether the list is huge or not This, plus your indication that only people sorting truly huge lists should have to read the manual, suggests to me that defaulting to decoration-with-indices (perhaps with an option to omit the indices) might be a preferable chocie. Alex
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