From 6072bc60e4d4dafd0bd58e3a53830ebf89648d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Fri, 4 Jun 2021 18:14:18 +0200 Subject: [PATCH] minor refactor --- satella/coding/deleters.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/satella/coding/deleters.py b/satella/coding/deleters.py index 995fea49..b0130163 100644 --- a/satella/coding/deleters.py +++ b/satella/coding/deleters.py @@ -140,7 +140,7 @@ class ListDeleter(tp.Generic[T]): self.indices_to_delete = set() return self - def __next__(self): + def __next__(self) -> T: if self.direction == DIR_BACKWARD and self.current_index == 0: raise StopIteration('First element reached') if self.direction == DIR_FORWARD and self.current_index == len(self.list_to_process) - 1: @@ -153,8 +153,7 @@ class ListDeleter(tp.Generic[T]): :return: the next element :raises StopIteration: no more entries """ - next(self) - return self.list_to_process[self.current_index] + return next(self) def prev(self) -> T: """ -- GitLab