Skip to content

Commit 615e96f

Browse files
committed
Updated after review comments
1 parent 0bbe65c commit 615e96f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/library/argparse.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,25 +1127,25 @@ if the argument was not one of the acceptable values::
11271127
Any sequence can be passed as the *choices* value, so :class:`list` objects,
11281128
:class:`tuple` objects, and custom sequences are all supported.
11291129

1130-
Formatted choices override the default *metavar* which is normally derived
1131-
from *dest*. This is usually what you want because the user never sees the
1132-
*dest* parameter. If this display isn't desirable (perhaps because there are
1133-
many choices), just specify an explicit metavar_.
1130+
Use of :class:`enum.Enum` is not recommended because it is difficult to
1131+
control its appearance in usage, help, and error messages.
11341132

11351133
Note that inclusion in the *choices* sequence is checked after any type_
11361134
conversions have been performed, so the type of the objects in the *choices*
11371135
sequence should match the type_ specified. This may interfere with
11381136
the display of the choices in usage, help and error messages, because the
11391137
*choices* may not be familiar to the end-user.
11401138

1141-
Use of :class:`enum.Enum` is not recommended because it is difficult to
1142-
control its appearance in these messages.
1143-
11441139
If you have to use both *type* and *choices* you can use a wrapper class
11451140
that formats the value after type conversion back to the vocabulary of the
11461141
end-user. However, it is usually easier to not specify *type* and perform
11471142
type conversion in application code.
11481143

1144+
Formatted choices override the default *metavar* which is normally derived
1145+
from *dest*. This is usually what you want because the user never sees the
1146+
*dest* parameter. If this display isn't desirable (perhaps because there are
1147+
many choices), just specify an explicit metavar_.
1148+
11491149

11501150
.. _required:
11511151

0 commit comments

Comments
 (0)