From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 29 Aug 2019 08:15:18 +0000 (-0700) Subject: bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566... X-Git-Tag: v3.8.0b4~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d45d50e421b46b56195821580c3760b43813106;p=python bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566) (GH-15587) (cherry picked from commit 84125fed2a45a9e454d7e870d8bbaf6ece3d41e8) Co-authored-by: Raymond Hettinger --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index ef2fd42783..368b1cfebf 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