@@ -765,7 +765,7 @@ The add_argument() method
765765
766766 * type _ - The type to which the command-line argument should be converted.
767767
768- * choices _ - A container of the allowable values for the argument.
768+ * choices _ - A sequence of the allowable values for the argument.
769769
770770 * required _ - Whether or not the command-line option may be omitted
771771 (optionals only).
@@ -1209,7 +1209,7 @@ choices
12091209^^^^^^^
12101210
12111211Some command-line arguments should be selected from a restricted set of values.
1212- These can be handled by passing a container object as the *choices * keyword
1212+ These can be handled by passing a sequence object as the *choices * keyword
12131213argument to :meth: `~ArgumentParser.add_argument `. When the command line is
12141214parsed, argument values will be checked, and an error message will be displayed
12151215if the argument was not one of the acceptable values::
@@ -1223,9 +1223,9 @@ if the argument was not one of the acceptable values::
12231223 game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',
12241224 'paper', 'scissors')
12251225
1226- Note that inclusion in the *choices * container is checked after any type _
1226+ Note that inclusion in the *choices * sequence is checked after any type _
12271227conversions have been performed, so the type of the objects in the *choices *
1228- container should match the type _ specified::
1228+ sequence should match the type _ specified::
12291229
12301230 >>> parser = argparse.ArgumentParser(prog='doors.py')
12311231 >>> parser.add_argument('door', type=int, choices=range(1, 4))
@@ -1235,8 +1235,8 @@ container should match the type_ specified::
12351235 usage: doors.py [-h] {1,2,3}
12361236 doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)
12371237
1238- Any container can be passed as the *choices * value, so :class: `list ` objects,
1239- :class: `set ` objects, and custom containers are all supported.
1238+ Any sequence can be passed as the *choices * value, so :class: `list ` objects,
1239+ :class: `tuple ` objects, and custom sequences are all supported.
12401240
12411241Use of :class: `enum.Enum ` is not recommended because it is difficult to
12421242control its appearance in usage, help, and error messages.
0 commit comments