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

Method bind_name_expr

mypy/semanal.py:5840–5853  ·  view source on GitHub ↗

Bind name expression to a symbol table node.

(self, expr: NameExpr, sym: SymbolTableNode)

Source from the content-addressed store, hash-verified

5838 self.bind_name_expr(expr, n)
5839
5840 def bind_name_expr(self, expr: NameExpr, sym: SymbolTableNode) -> None:
5841 """Bind name expression to a symbol table node."""
5842 if (
5843 isinstance(sym.node, TypeVarExpr)
5844 and self.tvar_scope.get_binding(sym)
5845 and not self.allow_unbound_tvars
5846 ):
5847 self.fail(f'"{expr.name}" is a type variable and only valid in type context', expr)
5848 elif isinstance(sym.node, PlaceholderNode):
5849 self.process_placeholder(expr.name, "name", expr)
5850 else:
5851 expr.kind = sym.kind
5852 expr.node = sym.node
5853 expr.fullname = sym.fullname or ""
5854
5855 def visit_super_expr(self, expr: SuperExpr) -> None:
5856 if not self.type and not expr.call.args:

Callers 2

visit_name_exprMethod · 0.95

Calls 4

failMethod · 0.95
process_placeholderMethod · 0.95
isinstanceFunction · 0.85
get_bindingMethod · 0.80

Tested by

no test coverage detected