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

Method visit_starred_pattern

mypy/checkpattern.py:481–486  ·  view source on GitHub ↗
(self, o: StarredPattern)

Source from the content-addressed store, hash-verified

479 return new_types
480
481 def visit_starred_pattern(self, o: StarredPattern) -> PatternType:
482 captures: dict[Expression, Type] = {}
483 if o.capture is not None:
484 list_type = self.chk.named_generic_type("builtins.list", [self.type_context[-1]])
485 captures[o.capture] = list_type
486 return PatternType(self.type_context[-1], UninhabitedType(), captures)
487
488 def visit_mapping_pattern(self, o: MappingPattern) -> PatternType:
489 current_type = get_proper_type(self.type_context[-1])

Callers

nothing calls this directly

Calls 3

UninhabitedTypeClass · 0.90
PatternTypeClass · 0.85
named_generic_typeMethod · 0.45

Tested by

no test coverage detected