
Sept. 5, 2009
9:47 a.m.
On Fri, 4 Sep 2009 10:01:28 pm Matteo Dell'Amico wrote:
Why? next(iter(obj)) means, pretty explicitly to me, "iterate on obj and give me one element".
To me, it says "give me the first element", not "give me any (an arbitrary) element" or "give me a random element". Does anyone have a use-case for retrieving a single arbitrary element of an arbitrary sequence, without caring about any other elements? Is this really such a common operation that we need to consider it part of the interface for all collections? I doubt it. -- Steven D'Aprano