Discussion:
[Python-3000-checkins] r65298 - python/branches/py3k/Doc/library/itertools.rst
raymond.hettinger
2008-07-30 07:45:01 UTC
Permalink
Author: raymond.hettinger
Date: Wed Jul 30 09:45:01 2008
New Revision: 65298

Log:
Fix-up recipe with a syntax error (as discussed on python-dev).

Modified:
python/branches/py3k/Doc/library/itertools.rst

Modified: python/branches/py3k/Doc/library/itertools.rst
==============================================================================
--- python/branches/py3k/Doc/library/itertools.rst (original)
+++ python/branches/py3k/Doc/library/itertools.rst Wed Jul 30 09:45:01 2008
@@ -565,7 +565,8 @@
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
- return zip_longest(*args, fillvalue=fillvalue)
+ kwds = dict(fillvalue=fillvalue)
+ return zip_longest(*args, **kwds)

def roundrobin(*iterables):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
Guido van Rossum
2008-07-30 20:41:57 UTC
Permalink
Are you going to fix this one again?

On Wed, Jul 30, 2008 at 12:45 AM, raymond.hettinger
Post by raymond.hettinger
Author: raymond.hettinger
Date: Wed Jul 30 09:45:01 2008
New Revision: 65298
Fix-up recipe with a syntax error (as discussed on python-dev).
python/branches/py3k/Doc/library/itertools.rst
Modified: python/branches/py3k/Doc/library/itertools.rst
==============================================================================
--- python/branches/py3k/Doc/library/itertools.rst (original)
+++ python/branches/py3k/Doc/library/itertools.rst Wed Jul 30 09:45:01 2008
@@ -565,7 +565,8 @@
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
- return zip_longest(*args, fillvalue=fillvalue)
+ kwds = dict(fillvalue=fillvalue)
+ return zip_longest(*args, **kwds)
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
_______________________________________________
Python-3000-checkins mailing list
Python-3000-checkins at python.org
http://mail.python.org/mailman/listinfo/python-3000-checkins
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
Loading...