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

Method visit_MatchMapping

mypy/fastparse.py:1795–1805  ·  view source on GitHub ↗
(self, n: ast3.MatchMapping)

Source from the content-addressed store, hash-verified

1793 return self.set_line(node, n)
1794
1795 def visit_MatchMapping(self, n: ast3.MatchMapping) -> MappingPattern:
1796 keys = [self.visit(k) for k in n.keys]
1797 values = [self.visit(v) for v in n.patterns]
1798
1799 if n.rest is None:
1800 rest = None
1801 else:
1802 rest = self.set_line(NameExpr(n.rest), n)
1803
1804 node = MappingPattern(keys, values, rest)
1805 return self.set_line(node, n)
1806
1807 def visit_MatchClass(self, n: ast3.MatchClass) -> ClassPattern:
1808 class_ref = self.visit(n.cls)

Callers

nothing calls this directly

Calls 4

visitMethod · 0.95
set_lineMethod · 0.95
NameExprClass · 0.90
MappingPatternClass · 0.90

Tested by

no test coverage detected