Add `info` attribute to all relevant components of the node.
(node: SymbolNode, info: TypeInfo)
| 5376 | |
| 5377 | |
| 5378 | def set_info(node: SymbolNode, info: TypeInfo) -> None: |
| 5379 | """Add `info` attribute to all relevant components of the node.""" |
| 5380 | if isinstance(node, (FuncDef, Var)): |
| 5381 | node.info = info |
| 5382 | elif isinstance(node, Decorator): |
| 5383 | node.var.info = info |
| 5384 | node.func.info = info |
| 5385 | elif isinstance(node, OverloadedFuncDef): |
| 5386 | node.info = info |
| 5387 | for item in node.items: |
| 5388 | set_info(item, info) |
| 5389 | if node.impl: |
| 5390 | set_info(node.impl, info) |
| 5391 | |
| 5392 | |
| 5393 | # See docstring for mypy/cache.py for reserved tag ranges. |
no test coverage detected
searching dependent graphs…