Push a value onto the stack. Args: value: The value to push.
(self, value: object)
| 157 | probe = probe.next |
| 158 | |
| 159 | def push(self, value: object) -> None: |
| 160 | """Push a value onto the stack. |
| 161 | |
| 162 | Args: |
| 163 | value: The value to push. |
| 164 | """ |
| 165 | node = StackNode(value) |
| 166 | node.next = self.head |
| 167 | self.head = node |
| 168 | self._top += 1 |
| 169 | |
| 170 | def pop(self) -> object: |
| 171 | """Remove and return the top element. |