diff --git a/Graph/graph/helpers.py b/Graph/graph/helpers.py index ef63564627acbbeec37d96e391a01f1b3384a839..bc002fab841d3c3c8e8346be9f8f057e9be01f6a 100644 --- a/Graph/graph/helpers.py +++ b/Graph/graph/helpers.py @@ -23,6 +23,11 @@ class AbstractQueue(metaclass=ABCMeta): def __contains__(self, item: Any) -> bool: return item in self._queue + + def __str__(self): + return f"{self.__class__.__name__}({str(self._queue)[6:-1]})" + + @abstractmethod def add(self, item: Any) -> None: return None @@ -36,7 +41,7 @@ class FIFO(AbstractQueue): """ This structure allow to store any object, The First element add to the structure will be the First element removed from it. - *F*irst *I*n *F*irst *O*ut + **F**\ irst **I**\ n **F**\ irst **O**\ ut """ def add(self, item: Any) -> Any: @@ -65,7 +70,7 @@ class LIFO(AbstractQueue): """ This structure allow to store any object, The Last element add to the structure will be the First element removed from it. - *L*ast *I*n *F*irst *O*ut + **L**\ ast **I**\ n **F**\ irst **O**\ ut """ def add(self, item: Any) -> None: