Message116186
> As an aside, I still like Jeffrey Yasskin's suggestion on the
> python-dev mailing list that the sensible definition for max would
> maintain the invariant that max(iterable) be equivalent to
> sorted(iterable)[-1]
What's interesting is the practical consequence that:
x, y = min(x, y), max(x, y)
cannot give you twice the same object.
Of course, there are subtle implications of how it will be implemented (especially with objects which have a partial order relationship to each other). Since max() is supposed to work on any iterator, we probably don't want to build an intermediate sequence and fetch elements in reverse order; instead perhaps use (not Py_LT) instead of Py_GT. |
|
Date |
User |
Action |
Args |
2010-09-12 12:52:39 | pitrou | set | recipients:
+ pitrou, rhettinger, mark.dickinson, mattheww, jyasskin, docs@python |
2010-09-12 12:52:39 | pitrou | set | messageid: <1284295959.07.0.532242446739.issue9802@psf.upfronthosting.co.za> |
2010-09-12 12:52:37 | pitrou | link | issue9802 messages |
2010-09-12 12:52:37 | pitrou | create | |
|