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

Method visit_Attribute

mypy/fastparse.py:1711–1723  ·  view source on GitHub ↗
(self, n: Attribute)

Source from the content-addressed store, hash-verified

1709
1710 # Attribute(expr value, identifier attr, expr_context ctx)
1711 def visit_Attribute(self, n: Attribute) -> MemberExpr | SuperExpr:
1712 value = n.value
1713 member_expr = MemberExpr(self.visit(value), n.attr)
1714 obj = member_expr.expr
1715 if (
1716 isinstance(obj, CallExpr)
1717 and isinstance(obj.callee, NameExpr)
1718 and obj.callee.name == "super"
1719 ):
1720 e: MemberExpr | SuperExpr = SuperExpr(member_expr.name, obj)
1721 else:
1722 e = member_expr
1723 return self.set_line(e, n)
1724
1725 # Subscript(expr value, slice slice, expr_context ctx)
1726 def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr:

Callers

nothing calls this directly

Calls 5

visitMethod · 0.95
set_lineMethod · 0.95
MemberExprClass · 0.90
SuperExprClass · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected