8000 bpo-16468: Clarify which objects can be passed to "choices" in argpar… · python/cpython@0d45d50 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d45d50

Browse files
bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566) (GH-15587)
(cherry picked from commit 84125fe) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
1 parent 102130a commit 0d45d50

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Doc/library/argparse.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,9 +1102,8 @@ container should match the type_ specified::
11021102
usage: doors.py [-h] {1,2,3}
11031103
doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)
11041104

1105-
Any object that supports the ``in`` operator can be passed as the *choices*
1106-
value, so :class:`dict` objects, :class:`set` objects, custom containers,
1107-
etc. are all supported.
1105+
Any container can be passed as the *choices* value, so :class:`list` objects,
1106+
:class:`set` objects, and custom containers are all supported.
11081107

11091108

11101109
required

0 commit comments

Comments
 (0)
0