Skip to content

Commit

Permalink
Fixed type — should be enum.Flag, not enum.Flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
erictraut committed Mar 27, 2024
1 parent f6b4ae5 commit 79e64e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/spec/enums.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ Enum Literal Expansion

From the perspective of the type system, an most enum classes are equivalent
to the union of the literal members within that enum. (This rule
does not apply to classes that derive from ``enum.Flags`` because these enums
does not apply to classes that derive from ``enum.Flag`` because these enums
allow flags to be combined in arbitrary ways.) Because of the equivalency
between an enum class and the union of literal members within that enum, the
two types may be used interchangeably. Type checkers may therefore expand
an enum type (that does not derive from ``enum.Flags``) into a union of
an enum type (that does not derive from ``enum.Flag``) into a union of
literal values during type narrowing and exhaustion detection::

class Color(Enum):
Expand Down

0 comments on commit 79e64e8

Please sign in to comment.