Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/rich/_stack.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-07 06:07 +0000

1from typing import List, TypeVar 

2 

3T = TypeVar("T") 

4 

5 

6class 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)