basedpyright
basedpyright copied to clipboard
warn when enum member is non-determinate
Description
def f() -> object:
return lambda: 1
class E(Enum):
a = f() # expect error: `object` can potentially be `FunctionType`, wrap this value with `enum.member` to enforce expected runtime behaviour
E.a.name # fails at runtime
FunctionType becomes a non-member, but currently pyright assumes a super type of FunctionType is a member, use enum.member to override this and make it a member
i dont get it, can u provide more info on exactly what the issue is
try using it and you will see, it's completely unsound