Skip to content

Commit 22bd12b

Browse files
black24
1 parent 568e7c8 commit 22bd12b

File tree

10 files changed

+80
-146
lines changed

10 files changed

+80
-146
lines changed

asyncstdlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The missing async toolbox"""
2+
23
from .builtins import (
34
anext,
45
zip,

asyncstdlib/_core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Any helpers in this module are *not* bound to maintaining a public interface,
88
and offer less convenience to save on overhead.
99
"""
10+
1011
from inspect import iscoroutinefunction
1112
from typing import (
1213
Any,

asyncstdlib/_lrucache.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
several performance hacks are skipped in favour of maintainability,
66
especially when they might not apply to PyPy.
77
"""
8+
89
from typing import (
910
NamedTuple,
1011
Callable,
@@ -154,15 +155,13 @@ def __annotations__(self) -> Dict[str, Any]: # type: ignore
154155

155156

156157
@overload
157-
def lru_cache(maxsize: AC, typed: bool = ...) -> LRUAsyncCallable[AC]:
158-
...
158+
def lru_cache(maxsize: AC, typed: bool = ...) -> LRUAsyncCallable[AC]: ...
159159

160160

161161
@overload
162162
def lru_cache(
163163
maxsize: Optional[int] = ..., typed: bool = ...
164-
) -> Callable[[AC], LRUAsyncCallable[AC]]:
165-
...
164+
) -> Callable[[AC], LRUAsyncCallable[AC]]: ...
166165

167166

168167
@public_module("asyncstdlib.functools")

asyncstdlib/_typing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
This module is for internal use only. Do *not* put any new
55
"async typing" definitions here.
66
"""
7+
78
from typing import (
89
TypeVar,
910
Hashable,

asyncstdlib/asynctools.py

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ async def apply(
222222
__func: Callable[[T1], T],
223223
__arg1: Awaitable[T1],
224224
/,
225-
) -> T:
226-
...
225+
) -> T: ...
227226

228227

229228
@overload
@@ -232,8 +231,7 @@ async def apply(
232231
__arg1: Awaitable[T1],
233232
__arg2: Awaitable[T2],
234233
/,
235-
) -> T:
236-
...
234+
) -> T: ...
237235

238236

239237
@overload
@@ -243,8 +241,7 @@ async def apply(
243241
__arg2: Awaitable[T2],
244242
__arg3: Awaitable[T3],
245243
/,
246-
) -> T:
247-
...
244+
) -> T: ...
248245

249246

250247
@overload
@@ -255,8 +252,7 @@ async def apply(
255252
__arg3: Awaitable[T3],
256253
__arg4: Awaitable[T4],
257254
/,
258-
) -> T:
259-
...
255+
) -> T: ...
260256

261257

262258
@overload
@@ -268,8 +264,7 @@ async def apply(
268264
__arg4: Awaitable[T4],
269265
__arg5: Awaitable[T5],
270266
/,
271-
) -> T:
272-
...
267+
) -> T: ...
273268

274269

275270
@overload
@@ -278,8 +273,7 @@ async def apply(
278273
/,
279274
*args: Awaitable[Any],
280275
**kwargs: Awaitable[Any],
281-
) -> T:
282-
...
276+
) -> T: ...
283277

284278

285279
async def apply(
@@ -313,13 +307,11 @@ async def compute_something_else() -> float:
313307

314308

315309
@overload
316-
def sync(function: Callable[..., Awaitable[T]], /) -> Callable[..., Awaitable[T]]:
317-
...
310+
def sync(function: Callable[..., Awaitable[T]], /) -> Callable[..., Awaitable[T]]: ...
318311

319312

320313
@overload
321-
def sync(function: Callable[..., T], /) -> Callable[..., Awaitable[T]]:
322-
...
314+
def sync(function: Callable[..., T], /) -> Callable[..., Awaitable[T]]: ...
323315

324316

325317
def sync(function: Callable[..., Any], /) -> Callable[..., Any]:
@@ -415,11 +407,11 @@ async def await_iter(n):
415407
iterable = __iter if not isinstance(__iter, Awaitable) else await __iter
416408
if isinstance(iterable, AsyncIterable):
417409
async for item in iterable:
418-
yield item if not isinstance(
419-
item, Awaitable
420-
) else await item # pyright: ignore[reportGeneralTypeIssues]
410+
yield (
411+
item if not isinstance(item, Awaitable) else await item
412+
) # pyright: ignore[reportGeneralTypeIssues]
421413
else:
422414
for item in iterable:
423-
yield item if not isinstance(
424-
item, Awaitable
425-
) else await item # pyright: ignore[reportGeneralTypeIssues]
415+
yield (
416+
item if not isinstance(item, Awaitable) else await item
417+
) # pyright: ignore[reportGeneralTypeIssues]

0 commit comments

Comments
 (0)