Skip to content

Commit 4ec2149

Browse files
bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884) (GH-23894)
1 parent 7c48859 commit 4ec2149

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Doc/library/argparse.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,11 @@ Any container can be passed as the *choices* value, so :class:`list` objects,
11521152
Use of :class:`enum.Enum` is not recommended because it is difficult to
11531153
control its appearance in usage, help, and error messages.
11541154

1155+
Formatted choices overrides the default *metavar* which is normally derived
1156+
from *dest*. This is usually what you want because the user never sees the
1157+
*dest* parameter. If this display isn't desirable (perhaps because there are
1158+
many choices), just specify an explicit metavar_.
1159+
11551160

11561161
required
11571162
^^^^^^^^

0 commit comments

Comments
 (0)