I have a class that uses its attributes as a dictionary. Like this:
class Foo:
def set(self, name: str, value: int):
setattr(self, name, value)
def get(self, name: str) -> Optional[int]:
return getattr(self, name, None)
Is there any way to write down a type annotation to indicate that all member variables are int (if present)? Ideally in a way that Pyright understands.