Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
_stack.py17 linesDownload Raw Back to rich
1from typing import List, TypeVar2 3T = TypeVar("T")4 5 6class Stack(List[T]):7    """A small shim over builtin list."""8 9    @property10    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)17 
codekingpro/portable-devtools · Team Ai