← Files AgentBrokoARCHIVED FILE

.venv/Lib/site-packages/pip/_vendor/rich/_stack.py

351 Bytes · Sep 30, 2026 · 23:15 UTC

↓ Download file

from typing import List, TypeVar

T = TypeVar("T")


class Stack(List[T]):
    """A small shim over builtin list."""

    @property
    def top(self) -> T:
        """Get top of stack."""
        return self[-1]

    def push(self, item: T) -> None:
        """Push an item on to the stack (append in stack nomenclature)."""
        self.append(item)

SHA-256: f82f0e2bbaf19f7b0851d570c59041a5e1e12335f4788f9533731e9987da5e6d