Hi, Andreas Klöckner <lists <at> informa.tiker.net> writes: > list_len = single_valued(len(l) for l in lists) length, = set(map(len, lists)) > what_i_am_looking_for = one(item for item in items if predicate(item)) Is that really such a common case? In Python 2.6 you can use next for the same thing however without the check if there is just one item: what_i_am_looking_for = next(filter(predicate, items)) What I would like to see is a batch function defined like that: def batch(iterable, n): return izip(*repeat(iter(iterable), n)) It's a common pattern I use it very often. Regards, Armin
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