I have the following classes:
@dataclass class Node: def token(self) ... @dataclass class Program(Node): statements: List[str] @dataclass class Statement(Node): left: Node ...
They is a fair amount of them but all in one or the other way inherit from
In a later point in my code I am trying
def run(node: Node): if type(node) == Program: x = node.statements elif type(node) == Statement: x = node.left
Pycharm is complaining for
Unresolved attribute reference 'statements' for class 'Node'.
How can I correctly hint the specific
node type in each case?