diff options
author | Raymond Hettinger <python@rcn.com> | 2013-05-06 02:53:41 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-05-06 02:53:41 (GMT) |
commit | 44571daf0e3a1df376dc97551643281bdf2dbcb8 (patch) | |
tree | 5531b6276ef358ae55bcaec90d37e53e3c15a85e /Doc/library | |
parent | 5b1ab247510d4f4fc566b62e8928646ebe276d49 (diff) | |
download | cpython-44571daf0e3a1df376dc97551643281bdf2dbcb8.zip cpython-44571daf0e3a1df376dc97551643281bdf2dbcb8.tar.gz cpython-44571daf0e3a1df376dc97551643281bdf2dbcb8.tar.bz2 |
Issue 17862: Improve the signature of itertools grouper() recipe.
Putting *n* after the *iterable* matches the signature of other itertools
and recipes. Also, it reads better.
Suggested by Ezio Melotti.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/itertools.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 1eb554a..7099fa0 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -705,9 +705,9 @@ which incur interpreter overhead. next(b, None) return zip(a, b) - def grouper(n, iterable, fillvalue=None): + def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" - # grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" + # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n return zip_longest(*args, fillvalue=fillvalue) |