relib 1.3.12__tar.gz → 1.3.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: relib
3
- Version: 1.3.12
3
+ Version: 1.3.13
4
4
  Project-URL: Repository, https://github.com/Reddan/relib.git
5
5
  Author: Hampus Hallman
6
6
  License: Copyright 2018-2025 Hampus Hallman
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "relib"
3
- version = "1.3.12"
3
+ version = "1.3.13"
4
4
  requires-python = ">=3.10"
5
5
  dependencies = []
6
6
  authors = [
@@ -100,9 +100,10 @@ class seekable(Generic[T]):
100
100
  def __bool__(self):
101
101
  return bool(self[:1])
102
102
 
103
- def clear(self):
103
+ def clear(self) -> seekable[T]:
104
104
  self.sink[:self.index] = []
105
105
  self.index = 0
106
+ return self
106
107
 
107
108
  def seek(self, index: int) -> seekable[T]:
108
109
  index = max(0, index)
@@ -208,6 +209,6 @@ def unzip_iterable(iterable: Iterable[tuple[T1, T2, T3]], n: Literal[3]) -> tupl
208
209
  def unzip_iterable(iterable: Iterable[tuple[T1, T2, T3, T4]], n: Literal[4]) -> tuple[Iterable[T1], Iterable[T2], Iterable[T3], Iterable[T4]]: ...
209
210
  @overload
210
211
  def unzip_iterable(iterable: Iterable[tuple[T1, T2, T3, T4, T5]], n: Literal[5]) -> tuple[Iterable[T1], Iterable[T2], Iterable[T3], Iterable[T4], Iterable[T5]]: ...
211
- def unzip_iterable(iterable: Iterable[tuple], n: int) -> tuple:
212
+ def unzip_iterable(iterable: Iterable[tuple], n: int) -> tuple[Iterable, ...]:
212
213
  iters = tee(iterable, n)
213
214
  return tuple(map(lambda i, iter: (x[i] for x in iter), range(n), iters))
@@ -5,7 +5,7 @@ import sys
5
5
  from concurrent.futures import ThreadPoolExecutor
6
6
  from functools import partial, wraps
7
7
  from time import time
8
- from typing import Callable, Coroutine, Iterable, ParamSpec, TypeVar
8
+ from typing import Awaitable, Callable, Coroutine, Iterable, ParamSpec, TypeVar
9
9
  from .iter_utils import as_list
10
10
  from .processing_utils import noop
11
11
  from .types import T
@@ -35,13 +35,13 @@ def clear_console() -> None:
35
35
  def console_link(text: str, url: str) -> str:
36
36
  return f"\033]8;;{url}\033\\{text}\033]8;;\033\\"
37
37
 
38
- async def worker(task: Coro[T], semaphore: asyncio.Semaphore, update=noop) -> T:
38
+ async def worker(task: Coro[T] | Awaitable[T], semaphore: asyncio.Semaphore, update=noop) -> T:
39
39
  async with semaphore:
40
40
  result = await task
41
41
  update()
42
42
  return result
43
43
 
44
- async def roll_tasks(tasks: Iterable[Coro[T]], workers=default_workers, progress=False) -> list[T]:
44
+ async def roll_tasks(tasks: Iterable[Coro[T] | Awaitable[T]], workers=default_workers, progress=False) -> list[T]:
45
45
  semaphore = asyncio.Semaphore(workers)
46
46
  if not progress:
47
47
  return await asyncio.gather(*[worker(task, semaphore) for task in tasks])
@@ -161,7 +161,7 @@ wheels = [
161
161
 
162
162
  [[package]]
163
163
  name = "relib"
164
- version = "1.3.12"
164
+ version = "1.3.13"
165
165
  source = { editable = "." }
166
166
 
167
167
  [package.dev-dependencies]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes