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

Class ClassPattern

mypy/patterns.py:127–150  ·  view source on GitHub ↗

The pattern Cls(...)

Source from the content-addressed store, hash-verified

125
126
127class ClassPattern(Pattern):
128 """The pattern Cls(...)"""
129
130 class_ref: RefExpr
131 positionals: list[Pattern]
132 keyword_keys: list[str]
133 keyword_values: list[Pattern]
134
135 def __init__(
136 self,
137 class_ref: RefExpr,
138 positionals: list[Pattern],
139 keyword_keys: list[str],
140 keyword_values: list[Pattern],
141 ) -> None:
142 super().__init__()
143 assert len(keyword_keys) == len(keyword_values)
144 self.class_ref = class_ref
145 self.positionals = positionals
146 self.keyword_keys = keyword_keys
147 self.keyword_values = keyword_values
148
149 def accept(self, visitor: PatternVisitor[T]) -> T:
150 return visitor.visit_class_pattern(self)

Callers 3

visit_MatchClassMethod · 0.90
visit_class_patternMethod · 0.90
read_patternFunction · 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…