fromtypingimportList,TypeVarT=TypeVar("T")classStack(List[T]):"""A small shim over builtin list."""@propertydeftop(self)->T:"""Get top of stack."""returnself[-1]defpush(self,item:T)->None:"""Push an item on to the stack (append in stack nomenclature)."""self.append(item)