Jiba <jibal...@free.fr> added the comment: Ok, I understand.
However, in my initial problem, the sequence passed to groupby was a set, e.g. (modifying my previous example) : groupby(set([p1, p2, p3]), lambda p: p.key) If I understand well how groupby() works, the result of a groupby performed on a set is unpredictable, since it depends of the order of the items when iterating over the set. Perhaps the behavior of groupby() should be modified for unsorted sequences, possibly not taking the order into account, or raising an error ? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14828> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com