MCPcopy Create free account
hub / github.com/python/mypy / set_info

Function set_info

mypy/nodes.py:5378–5390  ·  view source on GitHub ↗

Add `info` attribute to all relevant components of the node.

(node: SymbolNode, info: TypeInfo)

Source from the content-addressed store, hash-verified

5376
5377
5378def 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.

Callers 1

nodeMethod · 0.85

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…