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

Class PatternType

mypy/checkpattern.py:82–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80# the PatternTypes of the sub-patterns first.
81# Using the data in the PatternType the match subject and captured names can be narrowed/inferred.
82class PatternType(NamedTuple):
83 type: Type # The type the match subject can be narrowed to
84 rest_type: Type # The remaining type if the pattern didn't match
85 captures: dict[Expression, Type] # The variables captured by the pattern
86
87
88class PatternChecker(PatternVisitor[PatternType]):

Callers 9

visit_as_patternMethod · 0.85
visit_or_patternMethod · 0.85
visit_value_patternMethod · 0.85
visit_starred_patternMethod · 0.85
visit_mapping_patternMethod · 0.85
visit_class_patternMethod · 0.85
early_non_matchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…