7stud wrote: > Bejeezus. The description of groupby in the docs is a poster child > for why the docs need user comments. Can someone explain to me in > what sense the name 'uniquekeys' is used this example: >
This is my first exposure to this function, and I see that it does have some uses in my code. I agree that it is confusing, however. IMO the confusion could be lessened if the function with the current behavior were renamed 'telescope' or 'compact' or 'collapse' or something (since it collapses the iterable linearly over homogeneous sequences.) A function named groupby could then have what I think is the clearly implied behavior of creating just one iterator for each unique type of thing in the input list, as categorized by the key function. -- http://mail.python.org/mailman/listinfo/python-list