[Python-checkins] bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566)

Raymond Hettinger webhook-mailer at python.org
Thu Aug 29 03:58:12 EDT 2019


https://github.com/python/cpython/commit/84125fed2a45a9e454d7e870d8bbaf6ece3d41e8
commit: 84125fed2a45a9e454d7e870d8bbaf6ece3d41e8
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-08-29T00:58:08-07:00
summary:

bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566)

files:
M Doc/library/argparse.rst

diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index ef2fd42783c8..368b1cfebf05 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1102,9 +1102,8 @@ container should match the type_ specified::
    usage: doors.py [-h] {1,2,3}
    doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)
 
-Any object that supports the ``in`` operator can be passed as the *choices*
-value, so :class:`dict` objects, :class:`set` objects, custom containers,
-etc. are all supported.
+Any container can be passed as the *choices* value, so :class:`list` objects,
+:class:`set` objects, and custom containers are all supported.
 
 
 required



More information about the Python-checkins mailing list