Skip to content

Commit 011b9f9

Browse files
authored
Update docs for enum choice (#2928)
2 parents 9ce34f2 + fb240d2 commit 011b9f9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/parameter-types.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ Example:
3333
import enum
3434

3535
class HashType(enum.Enum):
36-
MD5 = 'MD5'
37-
SHA1 = 'SHA1'
36+
MD5 = enum.auto()
37+
SHA1 = enum.auto()
3838

3939
@click.command()
4040
@click.option('--hash-type',
@@ -54,9 +54,8 @@ What it looks like:
5454
println()
5555
invoke(digest, args=['--help'])
5656

57-
Since version 8.2.0 any iterable may be passed to :class:`Choice`, here
58-
an ``Enum`` is used which will result in all enum values to be valid
59-
choices.
57+
Any iterable may be passed to :class:`Choice`. If an ``Enum`` is passed, the
58+
names of the enum members will be used as valid choices.
6059

6160
Choices work with options that have ``multiple=True``. If a ``default``
6261
value is given with ``multiple=True``, it should be a list or tuple of

0 commit comments

Comments
 (0)