Add a new item to the top of the stack.
(self, obj: T)
| 138 | self._storage.set([]) |
| 139 | |
| 140 | def push(self, obj: T) -> list[T]: |
| 141 | """Add a new item to the top of the stack.""" |
| 142 | stack = self._storage.get([]).copy() |
| 143 | stack.append(obj) |
| 144 | self._storage.set(stack) |
| 145 | return stack |
| 146 | |
| 147 | def pop(self) -> T | None: |
| 148 | """Remove the top item from the stack and return it. If the |