init
This commit is contained in:
commit
38355d2442
9083 changed files with 1225834 additions and 0 deletions
16
.venv/lib/python3.8/site-packages/rich/_stack.py
Normal file
16
.venv/lib/python3.8/site-packages/rich/_stack.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue