MCPcopy Index your code
hub / github.com/python/mypy / get_fullname_for_hook

Method get_fullname_for_hook

mypy/semanal.py:2197–2211  ·  view source on GitHub ↗
(self, expr: Expression)

Source from the content-addressed store, hash-verified

2195 dataclasses_plugin.add_dataclass_tag(defn.info)
2196
2197 def get_fullname_for_hook(self, expr: Expression) -> str | None:
2198 if isinstance(expr, CallExpr):
2199 return self.get_fullname_for_hook(expr.callee)
2200 elif isinstance(expr, IndexExpr):
2201 return self.get_fullname_for_hook(expr.base)
2202 elif isinstance(expr, RefExpr):
2203 if expr.fullname:
2204 return expr.fullname
2205 # If we don't have a fullname look it up. This happens because base classes are
2206 # analyzed in a different manner (see exprtotype.py) and therefore those AST
2207 # nodes will not have full names.
2208 sym = self.lookup_type_node(expr)
2209 if sym:
2210 return sym.fullname
2211 return None
2212
2213 def analyze_class_keywords(self, defn: ClassDef) -> None:
2214 for value in defn.keywords.values():

Callers 2

apply_hooks_to_classFunction · 0.80

Calls 2

lookup_type_nodeMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected