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

Class NameExpr

mypy/nodes.py:2426–2446  ·  view source on GitHub ↗

Name expression This refers to a local name, global name or a module.

Source from the content-addressed store, hash-verified

2424
2425
2426class NameExpr(RefExpr):
2427 """Name expression
2428
2429 This refers to a local name, global name or a module.
2430 """
2431
2432 __slots__ = ("name", "is_special_form")
2433
2434 __match_args__ = ("name", "node")
2435
2436 def __init__(self, name: str) -> None:
2437 super().__init__()
2438 self.name = name # Name referred to
2439 # Is this a l.h.s. of a special form assignment like typed dict or type variable?
2440 self.is_special_form = False
2441
2442 def accept(self, visitor: ExpressionVisitor[T]) -> T:
2443 return visitor.visit_name_expr(self)
2444
2445 def serialize(self) -> JsonDict:
2446 assert False, f"Serializing NameExpr: {self}"
2447
2448
2449class MemberExpr(RefExpr):

Callers 15

check_func_defMethod · 0.90
check_init_subclassMethod · 0.90
replace_partial_typeMethod · 0.90
visit_global_declMethod · 0.90
visit_TryMethod · 0.90
visit_TryStarMethod · 0.90
visit_ConstantMethod · 0.90
visit_NameMethod · 0.90
visit_MatchStarMethod · 0.90

Calls

no outgoing calls

Tested by 6

make_callFunction · 0.72
test_basic_casesMethod · 0.72
test_multiple_groupsMethod · 0.72
test_single_pairMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…