You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtypingimportDictfromenumimportEnumclassE(Enum):
V='V'd= {} # type: Dict[E, int]deff(s: str):
e=E[s] # type: ignored[e] =0# Still error here
We have to use # type: ignore on the line e = E[s] because of #741. But somehow the type of e, when ignoring the error, is not Any but something else. So on the last line we get
__tmp__.py: note: In function "f":
__tmp__.py:8: error: Invalid index type "E" for "dict"
The weird thing is that if e had type E, d[e] would be valid, so the error is also somehow lying...
UPDATE: When trying to repro this, don't try E['V'] -- mypy sees the literal and gives some other error, probably also because of #741.