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

Method visit_MatchAs

mypy/fastparse.py:1818–1825  ·  view source on GitHub ↗
(self, n: ast3.MatchAs)

Source from the content-addressed store, hash-verified

1816
1817 # MatchAs(expr pattern, identifier name)
1818 def visit_MatchAs(self, n: ast3.MatchAs) -> AsPattern:
1819 if n.name is None:
1820 name = None
1821 else:
1822 name = NameExpr(n.name)
1823 name = self.set_line(name, n)
1824 node = AsPattern(self.visit(n.pattern), name)
1825 return self.set_line(node, n)
1826
1827 # MatchOr(expr* pattern)
1828 def visit_MatchOr(self, n: ast3.MatchOr) -> OrPattern:

Callers

nothing calls this directly

Calls 4

set_lineMethod · 0.95
visitMethod · 0.95
NameExprClass · 0.90
AsPatternClass · 0.90

Tested by

no test coverage detected