diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1005,7 +1005,7 @@ PROG: error: argument foo: '7' is not a perfect square The choices_ keyword argument may be more convenient for type checkers that -simply check against a range of values:: +simply check against a small range of values:: >>> parser = argparse.ArgumentParser(prog='PROG') >>> parser.add_argument('foo', type=int, choices=range(5, 10)) @@ -1021,11 +1021,11 @@ choices ^^^^^^^ -Some command-line arguments should be selected from a restricted set of values. -These can be handled by passing a container object as the ``choices`` keyword -argument to :meth:`~ArgumentParser.add_argument`. When the command line is -parsed, argument values will be checked, and an error message will be displayed if -the argument was not one of the acceptable values:: +Some command-line arguments should be selected from a small set of known +values. These can be handled by passing a container object as the ``choices`` +keyword argument to :meth:`~ArgumentParser.add_argument`. When the command +line is parsed, if the value for such an argument is not one of the allowed +choices, an error message will be displayed listing the allowed choices:: >>> parser = argparse.ArgumentParser(prog='PROG') >>> parser.add_argument('foo', choices='abc')