any() and all() Was: Pre-PEP: Dictionary accumulator methods
b at b.b
Sat Mar 19 18:48:51 CET 2005
Ah OK, I stand corrected. Whoops. I just read the web page and thought the
wrong thing, that makes sense.
> Think about it. A key= function is quite a different thing. It provides
> *temporary* comparison key while retaining the original value. IOW, your
> re-write is incorrect:
> >>> L = ['the', 'quick', 'brownish', 'toad']
> >>> max(L, key=len)
> >>> max(len(x) for x in L)
> Remain calm. Keep the faith. Guido's design works fine.
> No important use cases were left unserved by any() and all().
> Raymond Hettinger
More information about the Python-list