[Python-Dev] Behaviour of max() and min() with equal keys (original) (raw)
Matthew Woodcraft matthew at woodcraft.me.uk
Tue Sep 7 21:34:17 CEST 2010
- Previous message: [Python-Dev] r84576 - in python/branches/py3k: Doc/library/random.rst Lib/random.py Lib/test/test_random.py Misc/NEWS
- Next message: [Python-Dev] Behaviour of max() and min() with equal keys
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In CPython, the builtin max() and min() have the property that if there are items with equal keys, the first item is returned. From a quick look at their source, I think this is true for Jython and IronPython too.
However, this isn't currently a documented guarantee. Could it be made so? (As with the decision to declare sort() stable, it seems likely that by now there's code out there relying on it anyway.)
-M-
- Previous message: [Python-Dev] r84576 - in python/branches/py3k: Doc/library/random.rst Lib/random.py Lib/test/test_random.py Misc/NEWS
- Next message: [Python-Dev] Behaviour of max() and min() with equal keys
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]