summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-09-29 07:57:21 (GMT)
committerGitHub <noreply@github.com>2024-09-29 07:57:21 (GMT)
commitf1a2417b9e2993e584610851ac004c8b0599b323 (patch)
tree5b6aec01fa50ef586c97d701a9ad4be743a170e0 /Doc/library
parentdac4ec52866e4068f3ac33b4da1e1a1fe6fc2cba (diff)
downloadcpython-f1a2417b9e2993e584610851ac004c8b0599b323.zip
cpython-f1a2417b9e2993e584610851ac004c8b0599b323.tar.gz
cpython-f1a2417b9e2993e584610851ac004c8b0599b323.tar.bz2
gh-61181: Fix support of choices with string value in argparse (GH-124578)
Substrings of the specified string no longer considered valid values.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/argparse.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index d5a2189..a4683bc 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1823,7 +1823,7 @@ Sub-commands
>>>
>>> # create the parser for the "b" command
>>> parser_b = subparsers.add_parser('b', help='b help')
- >>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')
+ >>> parser_b.add_argument('--baz', choices=('X', 'Y', 'Z'), help='baz help')
>>>
>>> # parse some argument lists
>>> parser.parse_args(['a', '12'])