pyright
pyright copied to clipboard
Enum Nonmember Attribute Access Regression
There seems to be a regression with enum.nonmember
after upgrading to 1.1.363:
import enum
class MyEnum(enum.StrEnum):
VAL_1 = "val_1"
VAL_2 = "val_2"
_items = enum.nonmember({VAL_1: 1, VAL_2: 2})
def to_int(self) -> int:
return self._items[self]
Take this example, here Pyright isn't able to understand that __getitem__
is an attribute on the non-member dictionar.