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

Class MatchStmt

mypy/nodes.py:2186–2213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2184
2185
2186class MatchStmt(Statement):
2187 __slots__ = ("subject", "subject_dummy", "patterns", "guards", "bodies")
2188
2189 __match_args__ = ("subject", "patterns", "guards", "bodies")
2190
2191 subject: Expression
2192 subject_dummy: NameExpr | None
2193 patterns: list[Pattern]
2194 guards: list[Expression | None]
2195 bodies: list[Block]
2196
2197 def __init__(
2198 self,
2199 subject: Expression,
2200 patterns: list[Pattern],
2201 guards: list[Expression | None],
2202 bodies: list[Block],
2203 ) -> None:
2204 super().__init__()
2205 assert len(patterns) == len(guards) == len(bodies)
2206 self.subject = subject
2207 self.subject_dummy = None
2208 self.patterns = patterns
2209 self.guards = guards
2210 self.bodies = bodies
2211
2212 def accept(self, visitor: StatementVisitor[T]) -> T:
2213 return visitor.visit_match_stmt(self)
2214
2215
2216class TypeAliasStmt(Statement):

Callers 3

visit_MatchMethod · 0.90
visit_match_stmtMethod · 0.90
read_statementFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…