Skip to content

Commit

Permalink
util: remove has_next
Browse files Browse the repository at this point in the history
  • Loading branch information
ebonnal committed Oct 7, 2023
1 parent 771e2de commit 2ad73c0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions kioss/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
T = TypeVar("T")
R = TypeVar("R")

UNIQUE_VALUE = "__kioss__util__" + str(uuid.uuid4())

def sidify(func: Callable[[T], Any]) -> Callable[[T], T]:
def wrap(arg):
Expand Down Expand Up @@ -37,12 +36,6 @@ def identity(obj: T) -> T:
return obj


def has_next(iterator: Iterator[T]) -> Iterator[T]:
elem = next(iterator, UNIQUE_VALUE)
if elem == UNIQUE_VALUE:
return False
return itertools.chain([elem], iterator)

class QueueIterator(Iterator[T]):
INITIAL_BACKOFF_period = 0.005

Expand Down
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from queue import Queue

from kioss.util import QueueIterator, sidify, has_next
from kioss.util import QueueIterator, sidify


class TestUtil(unittest.TestCase):
Expand Down

0 comments on commit 2ad73c0

Please sign in to comment.