]> granicus.if.org Git - python/commitdiff
Merged revisions 65259,65263,65296,65307,65321 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Thu, 31 Jul 2008 20:21:46 +0000 (20:21 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 31 Jul 2008 20:21:46 +0000 (20:21 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65259 | benjamin.peterson | 2008-07-27 10:22:14 -0500 (Sun, 27 Jul 2008) | 1 line

  clarify Popen argument
........
  r65263 | andrew.kuchling | 2008-07-28 12:04:48 -0500 (Mon, 28 Jul 2008) | 1 line

  Clarify wording
........
  r65296 | raymond.hettinger | 2008-07-30 02:27:30 -0500 (Wed, 30 Jul 2008) | 1 line

  Neaten-up the itertools recipes.
........
  r65307 | benjamin.peterson | 2008-07-30 08:46:53 -0500 (Wed, 30 Jul 2008) | 1 line

  getrandombits is actually getrandbits
........
  r65321 | raymond.hettinger | 2008-07-30 20:19:50 -0500 (Wed, 30 Jul 2008) | 4 lines

  Alter recipe to show how to call izip_longest() with
  both a keyword argument and star arguments.
........

Doc/library/itertools.rst
Doc/library/random.rst
Doc/library/subprocess.rst
Lib/random.py
Lib/test/test_itertools.py

index 2d7e756f42dcd2f0b3b0b718c1c1b485f53a5a3a..a53988b21aba87a812363c0df5066ea52c1eed87 100644 (file)
@@ -566,8 +566,7 @@ which incur interpreter overhead.
    def grouper(n, iterable, fillvalue=None):
        "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
        args = [iter(iterable)] * n
-       kwds = dict(fillvalue=fillvalue)
-       return zip_longest(*args, **kwds)
+       return zip_longest(fillvalue=fillvalue, *args)
 
    def roundrobin(*iterables):
        "roundrobin('ABC', 'D', 'EF') --> A D E B F C"
index d8c3f5abbeb1fb6561fe9ee403dd95b05eb4c8b4..66db882f96c906bb03a318078396a8004d571e6d 100644 (file)
@@ -33,7 +33,7 @@ instances of :class:`Random` to get generators that don't share state.
 Class :class:`Random` can also be subclassed if you want to use a different
 basic generator of your own devising: in that case, override the :meth:`random`,
 :meth:`seed`, :meth:`getstate`, and :meth:`setstate`.
-Optionally, a new generator can supply a :meth:`getrandombits` method --- this
+Optionally, a new generator can supply a :meth:`getrandbits` method --- this
 allows :meth:`randrange` to produce selections over an arbitrarily large range.
 
 
index daa88b368d4ab1756c6899d87a857ba71581aaaa..bd927c01f76f4a3df3724fae7a6d4de3c142f673 100644 (file)
@@ -33,9 +33,10 @@ This module defines one class called :class:`Popen`:
 
    Arguments are:
 
-   *args* should be a string, or a sequence of program arguments.  The program to
-   execute is normally the first item in the args sequence or string, but can be
-   explicitly set by using the executable argument.
+   *args* should be a string, or a sequence of program arguments.  The program
+   to execute is normally the first item in the args sequence or the string if a
+   string is given, but can be explicitly set by using the *executable*
+   argument.
 
    On Unix, with *shell=False* (default): In this case, the Popen class uses
    :meth:`os.execvp` to execute the child program. *args* should normally be a
index e0c015d8e8c74c10a42fdea0cad8a40ef39bb7f0..70603ca2ae4ee1584bbaaccd845e68b4b128700c 100644 (file)
@@ -74,7 +74,7 @@ class Random(_random.Random):
     Class Random can also be subclassed if you want to use a different basic
     generator of your own devising: in that case, override the following
     methods:  random(), seed(), getstate(), and setstate().
-    Optionally, implement a getrandombits() method so that randrange()
+    Optionally, implement a getrandbits() method so that randrange()
     can cover arbitrarily large ranges.
 
     """
index 8c482c577b6a141f2344540f240f10ca974e236b..a0d45e32e239e5d26c880bc8ee54546f5178bf20 100644 (file)
@@ -1257,8 +1257,7 @@ Samuele
 >>> def grouper(n, iterable, fillvalue=None):
 ...     "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
 ...     args = [iter(iterable)] * n
-...     kwds = dict(fillvalue=fillvalue)
-...     return zip_longest(*args, **kwds)
+...     return zip_longest(fillvalue=fillvalue, *args)
 
 >>> def roundrobin(*iterables):
 ...     "roundrobin('ABC', 'D', 'EF') --> A D E B F C"