Raymond Hettinger <rhettin...@users.sourceforge.net> added the comment:
I prefer the docs the way they are. They help the reader understand the relationship between min, max, nsmallest, nlargest, and sorted. I'm not sure where you got the n * 10 <= len(iterable) switch-over point. That is arbitrary. The correct switchover point depends on the cost of the comparison function, whether the length of the input is known, whether the input data is partially ordered, memory constraints, whether a key function is used, and on other factors. FWIW, I also wrote the logic for random.sample(). The switchover logic was straight-forward because performance depended on factors that were fully known (length of input, sample size, memory utilization, and average number of probes for each strategy). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6614> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com