-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
priority-0-hightopic-fine-grained-incrementaltopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new plugins
Description
Currently plugins can add type information that requires reprocessing if another node is updated. This requires additional fine grained dependencies to be correct. For example:
# file a.py
@dataclass
class A:
x: int
# file b.py
from a import A
@dataclass
class B(A):
y: int
B(1, 2)Updating type of a.A.x requires re-checking (more precisely re-semantically analyzing) the B definition, and the B call later in b.py.
The idea is to give a possibility for plugins to add dependencies. It looks like the simplest way is to add an add_dependencies method to semantic analyzer interface with a signature like def (trigger_fullname: str, node_to_recheck: Node) -> None. Then hooks for class decorators, base classes, and metaclasses can use it when modifying a TypeInfo.
Metadata
Metadata
Assignees
Labels
priority-0-hightopic-fine-grained-incrementaltopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new plugins