@@ -755,7 +755,7 @@ The add_argument() method
755755
756756 * type _ - The type to which the command-line argument should be converted.
757757
758- * choices _ - A container of the allowable values for the argument.
758+ * choices _ - A sequence of the allowable values for the argument.
759759
760760 * required _ - Whether or not the command-line option may be omitted
761761 (optionals only).
@@ -1199,7 +1199,7 @@ choices
11991199^^^^^^^
12001200
12011201Some command-line arguments should be selected from a restricted set of values.
1202- These can be handled by passing a container object as the *choices * keyword
1202+ These can be handled by passing a sequence object as the *choices * keyword
12031203argument to :meth: `~ArgumentParser.add_argument `. When the command line is
12041204parsed, argument values will be checked, and an error message will be displayed
12051205if the argument was not one of the acceptable values::
@@ -1213,9 +1213,9 @@ if the argument was not one of the acceptable values::
12131213 game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',
12141214 'paper', 'scissors')
12151215
1216- Note that inclusion in the *choices * container is checked after any type _
1216+ Note that inclusion in the *choices * sequence is checked after any type _
12171217conversions have been performed, so the type of the objects in the *choices *
1218- container should match the type _ specified::
1218+ sequence should match the type _ specified::
12191219
12201220 >>> parser = argparse.ArgumentParser(prog='doors.py')
12211221 >>> parser.add_argument('door', type=int, choices=range(1, 4))
@@ -1225,8 +1225,8 @@ container should match the type_ specified::
12251225 usage: doors.py [-h] {1,2,3}
12261226 doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)
12271227
1228- Any container can be passed as the *choices * value, so :class: `list ` objects,
1229- :class: `set ` objects, and custom containers are all supported.
1228+ Any sequence can be passed as the *choices * value, so :class: `list ` objects,
1229+ :class: `tuple ` objects, and custom sequences are all supported.
12301230
12311231Use of :class: `enum.Enum ` is not recommended because it is difficult to
12321232control its appearance in usage, help, and error messages.
0 commit comments