summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2013-05-06 02:53:41 (GMT)
committerRaymond Hettinger <python@rcn.com>2013-05-06 02:53:41 (GMT)
commit44571daf0e3a1df376dc97551643281bdf2dbcb8 (patch)
tree5531b6276ef358ae55bcaec90d37e53e3c15a85e /Doc/library
parent5b1ab247510d4f4fc566b62e8928646ebe276d49 (diff)
downloadcpython-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.rst4
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)