Gordon Airporte <[EMAIL PROTECTED]> writes: > "itertools.groupby_except_the_notion_of_uniqueness_is_limited_to- > _contiguous_runs_of_elements_having_the_same_key()" doesn't have much > of a ring to it. I guess this gets back to documentation problems, > because the help string says nothing about this limitation: > > ''' > class groupby(__builtin__.object) > | groupby(iterable[, keyfunc]) -> create an iterator which returns > | (key, sub-iterator) grouped by each value of key(value). > | > '''
I wouldn't call it a "limitation"; it's a designed behavior which is the right thing for some purposes and maybe not for others. For example, groupby (as currently defined) works properly on infinite sequences, but a version that scans the entire sequence to get bring together every occurrence of every key would fail in that situation. I agree that the doc description could be reworded slightly. -- http://mail.python.org/mailman/listinfo/python-list