pytype
pytype copied to clipboard
Converting enum type into a list changes type to nothing
Consider the following example
from enum import Enum
class E(Enum):
A = 1
B = 2
for x in E:
reveal_type(x) # revealed as "E"
reveal_type(list(E)) # revealed as "List[nothing]"
Both with and without the --use-enum-overlay flag, pytype understands that iterating over an enum type returns elements of the enum. However, when converted into a list (I also tried tuple and iter), the element type turns into nothing.