diff options
author | Fred Drake <fdrake@acm.org> | 2011-03-03 05:27:17 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2011-03-03 05:27:17 (GMT) |
commit | 446230664b1bed00289e462008fbb671994f98b1 (patch) | |
tree | 11804fcf105a73cbf98116a00c0e7d7031ceff0b /Doc | |
parent | 863a0c3f53765d24e4e99c11571278ae4322f288 (diff) | |
download | cpython-446230664b1bed00289e462008fbb671994f98b1.zip cpython-446230664b1bed00289e462008fbb671994f98b1.tar.gz cpython-446230664b1bed00289e462008fbb671994f98b1.tar.bz2 |
issue 11372: use range instead of xrange
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/argparse.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 9a65ada..8bd3ca5 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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, |