class Linker(IdGeneratorMixIn, utils.LocalsVisitor): (source)
Walk on the project tree and resolve relationships. According to options the following attributes may be added to visited nodes: * uid, a unique identifier for the node (on astroid.Project, astroid.Module, astroid.Class and astroid.locals_type). Only if the linker has been instantiated with tag=True parameter (False by default). * Function a mapping from locals names to their bounded value, which may be a constant like a string or an integer, or an astroid node (on astroid.Module, astroid.Class and astroid.Function). * instance_attrs_type as locals_type but for klass member attributes (only on astroid.Class) * associations_type as instance_attrs_type but for association relationships * aggregations_type as instance_attrs_type but for aggregations relationships * implements, list of implemented interface _objects_ (only on astroid.Class nodes)
Static Method | handle |
Handle an astroid.assignattr node. |
Method | __init__ |
Undocumented |
Method | compute |
Should the module be added to dependencies ? |
Method | visit |
Visit an astroid.AssignName node. |
Method | visit |
Visit an astroid.Class node. |
Method | visit |
Visit an astroid.Function node. |
Method | visit |
Visit an astroid.Import node. |
Method | visit |
Visit an astroid.ImportFrom node. |
Method | visit |
Visit an astroid.Module node. |
Method | visit |
Visit a pyreverse.utils.Project node. |
Instance Variable | associations |
Undocumented |
Instance Variable | project |
Undocumented |
Instance Variable | tag |
Undocumented |
Method | _imported |
Notify an imported module, used to analyze dependencies. |
Inherited from IdGeneratorMixIn
:
Method | generate |
Generate a new identifier. |
Method | init |
Init the id counter. |
Instance Variable | id |
Undocumented |
Inherited from LocalsVisitor
(via IdGeneratorMixIn
):
Method | get |
Get callbacks from handler for the visited node. |
Method | visit |
Launch the visit starting from the given node. |
Instance Variable | _cache |
Undocumented |
Instance Variable | _visited |
Undocumented |
def handle_assignattr_type(node:
nodes.AssignAttr
, parent: nodes.ClassDef
):
(source)
¶
Handle an astroid.assignattr node. handle instance_attrs_type
Visit an astroid.Class node. * set the locals_type and instance_attrs_type mappings * set the implements list and build it * optionally tag the node with a unique id
Visit an astroid.Function node. * set the locals_type mapping * optionally tag the node with a unique id
Visit an astroid.Module node. * set the locals_type mapping * set the depends mapping * optionally tag the node with a unique id
nodes.Import|nodes.ImportFrom
, mod_path: str
, relative: bool
):
(source)
¶
Notify an imported module, used to analyze dependencies.