@@ -702,7 +702,7 @@ The add_argument() method
702702
703703 * type _ - The type to which the command-line argument should be converted.
704704
705- * choices _ - A container of the allowable values for the argument.
705+ * choices _ - A sequence of the allowable values for the argument.
706706
707707 * required _ - Whether or not the command-line option may be omitted
708708 (optionals only).
@@ -1124,7 +1124,7 @@ choices
11241124^^^^^^^
11251125
11261126Some command-line arguments should be selected from a restricted set of values.
1127- These can be handled by passing a container object as the *choices * keyword
1127+ These can be handled by passing a sequence object as the *choices * keyword
11281128argument to :meth: `~ArgumentParser.add_argument `. When the command line is
11291129parsed, argument values will be checked, and an error message will be displayed
11301130if the argument was not one of the acceptable values::
@@ -1138,9 +1138,9 @@ if the argument was not one of the acceptable values::
11381138 game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',
11391139 'paper', 'scissors')
11401140
1141- Note that inclusion in the *choices * container is checked after any type _
1141+ Note that inclusion in the *choices * sequence is checked after any type _
11421142conversions have been performed, so the type of the objects in the *choices *
1143- container should match the type _ specified::
1143+ sequence should match the type _ specified::
11441144
11451145 >>> parser = argparse.ArgumentParser(prog='doors.py')
11461146 >>> parser.add_argument('door', type=int, choices=range(1, 4))
@@ -1150,8 +1150,8 @@ container should match the type_ specified::
11501150 usage: doors.py [-h] {1,2,3}
11511151 doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)
11521152
1153- Any container can be passed as the *choices * value, so :class: `list ` objects,
1154- :class: `set ` objects, and custom containers are all supported.
1153+ Any sequence can be passed as the *choices * value, so :class: `list ` objects,
1154+ :class: `tuple ` objects, and custom sequences are all supported.
11551155
11561156Use of :class: `enum.Enum ` is not recommended because it is difficult to
11571157control its appearance in usage, help, and error messages.
0 commit comments