Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 2, 2024
1 parent 0f622ed commit f319685
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions mypy/typeops.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
)
from mypy.state import state
from mypy.types import (
ENUM_REMOVED_PROPS,
AnyType,
CallableType,
ExtraAttrs,
Expand Down Expand Up @@ -879,8 +878,7 @@ class Status(Enum):
elif isinstance(typ, Instance) and typ.type.fullname == target_fullname:
if typ.type.is_enum:
return make_simplified_union(
[LiteralType(name, typ) for name in typ.get_enum_values()],
contract_literals=False,
[LiteralType(name, typ) for name in typ.get_enum_values()], contract_literals=False
)
elif typ.type.fullname == "builtins.bool":
return make_simplified_union(
Expand Down
3 changes: 2 additions & 1 deletion mypy/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,8 @@ def is_singleton_type(self) -> bool:
def get_enum_values(self) -> list[str]:
"""Return the list of values for an Enum."""
return [
name for name, sym in self.type.names.items()
name
for name, sym in self.type.names.items()
if (
isinstance(sym.node, mypy.nodes.Var)
and name not in ENUM_REMOVED_PROPS
Expand Down

0 comments on commit f319685

Please sign in to comment.