def popleft(self) -> Any:
        # make sure the deque has elements to pop
        assert not self.is_empty(), "Deque is empty."

        topop = self._front
        self._front = self._front.next_node  # set new front and drop the first node
        self._front.prev_node = None

        self._len -= 1

        return topop.val