diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-09-29 07:57:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-29 07:57:21 (GMT) |
commit | f1a2417b9e2993e584610851ac004c8b0599b323 (patch) | |
tree | 5b6aec01fa50ef586c97d701a9ad4be743a170e0 /Doc/library | |
parent | dac4ec52866e4068f3ac33b4da1e1a1fe6fc2cba (diff) | |
download | cpython-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.rst | 2 |
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']) |