Check if item is in stack >>> S = Stack(3) >>> S.push(10) >>> 10 in S True >>> S = Stack(3) >>> S.push(10) >>> 20 in S False
(self, item: T)
| 142 | return len(self.stack) |
| 143 | |
| 144 | def __contains__(self, item: T) -> bool: |
| 145 | """ |
| 146 | Check if item is in stack |
| 147 | |
| 148 | >>> S = Stack(3) |
| 149 | >>> S.push(10) |
| 150 | >>> 10 in S |
| 151 | True |
| 152 | |
| 153 | >>> S = Stack(3) |
| 154 | >>> S.push(10) |
| 155 | >>> 20 in S |
| 156 | False |
| 157 | """ |
| 158 | return item in self.stack |
| 159 | |
| 160 | |
| 161 | def test_stack() -> None: |
nothing calls this directly
no outgoing calls
no test coverage detected