A small shim over builtin list.
| 4 | |
| 5 | |
| 6 | class Stack(List[T]): |
| 7 | """A small shim over builtin list.""" |
| 8 | |
| 9 | @property |
| 10 | def top(self) -> T: |
| 11 | """Get top of stack.""" |
| 12 | return self[-1] |
| 13 | |
| 14 | def push(self, item: T) -> None: |
| 15 | """Push an item on to the stack (append in stack nomenclature).""" |
| 16 | self.append(item) |
no outgoing calls