Skip to content

Commit

Permalink
append -> push
Browse files Browse the repository at this point in the history
  • Loading branch information
bleudev committed Jun 7, 2024
1 parent 72f56f2 commit 9603ffa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ufpy/ustack.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def pop(self) -> T:
"""
return self.__elements.pop()

def append(self, *items: T) -> UStack[T]:
def push(self, *items: T) -> UStack[T]:
"""Append items to stack"""
self.__elements.extend(items)
return UStack(iterable=self.__elements)
Expand All @@ -98,7 +98,7 @@ def __call__(self, func: Callable[[int, T], T2]) -> UStack[T2]:
def __add__(self, other: UStack[T2] | AnyCollection[T2] | T2) -> UStack[T | T2]:
other = convert_to_stack(other)
result = self.copy()
return result.append(*other.elements)
return result.push(*other.elements)

def __sub__(self, other: UStack[T] | AnyCollection[T] | T) -> UStack[T]:
other = convert_to_stack(other)
Expand Down

0 comments on commit 9603ffa

Please sign in to comment.