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

Class SingletonPattern

mypy/patterns.py:71–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70
71class SingletonPattern(Pattern):
72 # This can be exactly True, False or None
73 value: bool | None
74
75 def __init__(self, value: bool | None) -> None:
76 super().__init__()
77 self.value = value
78
79 def accept(self, visitor: PatternVisitor[T]) -> T:
80 return visitor.visit_singleton_pattern(self)
81
82
83class SequencePattern(Pattern):

Callers 3

visit_MatchSingletonMethod · 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…