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

Method visit_MatchClass

mypy/fastparse.py:1807–1815  ·  view source on GitHub ↗
(self, n: ast3.MatchClass)

Source from the content-addressed store, hash-verified

1805 return self.set_line(node, n)
1806
1807 def visit_MatchClass(self, n: ast3.MatchClass) -> ClassPattern:
1808 class_ref = self.visit(n.cls)
1809 assert isinstance(class_ref, RefExpr)
1810 positionals = [self.visit(p) for p in n.patterns]
1811 keyword_keys = n.kwd_attrs
1812 keyword_values = [self.visit(p) for p in n.kwd_patterns]
1813
1814 node = ClassPattern(class_ref, positionals, keyword_keys, keyword_values)
1815 return self.set_line(node, n)
1816
1817 # MatchAs(expr pattern, identifier name)
1818 def visit_MatchAs(self, n: ast3.MatchAs) -> AsPattern:

Callers

nothing calls this directly

Calls 4

visitMethod · 0.95
set_lineMethod · 0.95
ClassPatternClass · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected