[Python-checkins] r88718 - in python/branches/release32-maint: Doc/library/argparse.rst

fred.drake python-checkins at python.org
Thu Mar 3 06:29:59 CET 2011


Author: fred.drake
Date: Thu Mar 3 06:29:59 2011
New Revision: 88718
Log:
Merged revisions 88717 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
 r88717 | fred.drake | 2011年03月03日 00:27:17 -0500 (2011年3月03日) | 2 lines
 
 issue 11372: use range instead of xrange
........
Modified:
 python/branches/release32-maint/ (props changed)
 python/branches/release32-maint/Doc/library/argparse.rst
Modified: python/branches/release32-maint/Doc/library/argparse.rst
==============================================================================
--- python/branches/release32-maint/Doc/library/argparse.rst	(original)
+++ python/branches/release32-maint/Doc/library/argparse.rst	Thu Mar 3 06:29:59 2011
@@ -929,7 +929,7 @@
 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 @@
 
 >>> 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,


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /