]> granicus.if.org Git - python/commitdiff
Merged revisions 88717 via svnmerge from
authorFred Drake <fdrake@acm.org>
Thu, 3 Mar 2011 05:29:59 +0000 (05:29 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 3 Mar 2011 05:29:59 +0000 (05:29 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88717 | fred.drake | 2011-03-03 00:27:17 -0500 (Thu, 03 Mar 2011) | 2 lines

  issue 11372: use range instead of xrange
........

Doc/library/argparse.rst

index 9a65adad44777fa7169f47f34174aa188131cc2f..8bd3ca53bb5e846adcf0b0cbe5a2832a82901973 100644 (file)
@@ -929,7 +929,7 @@ The choices_ keyword argument may be more convenient for type checkers that
 simply check against a range of values::
 
    >>> parser = argparse.ArgumentParser(prog='PROG')
-   >>> parser.add_argument('foo', type=int, choices=xrange(5, 10))
+   >>> parser.add_argument('foo', type=int, choices=range(5, 10))
    >>> parser.parse_args('7'.split())
    Namespace(foo=7)
    >>> parser.parse_args('11'.split())
@@ -1303,7 +1303,7 @@ of :data:`sys.argv`.  This can be accomplished by passing a list of strings to
 
    >>> parser = argparse.ArgumentParser()
    >>> parser.add_argument(
-   ...     'integers', metavar='int', type=int, choices=xrange(10),
+   ...     'integers', metavar='int', type=int, choices=range(10),
    ...  nargs='+', help='an integer in the range 0..9')
    >>> parser.add_argument(
    ...     '--sum', dest='accumulate', action='store_const', const=sum,