Skip to content

Commit f9f7571

Browse files
v3.12.5 (#154)
* version bump * silence pyright errors
1 parent cb745e8 commit f9f7571

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

asyncstdlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from .asynctools import borrow, scoped_iter, await_each, any_iter, apply, sync
4646
from .heapq import merge, nlargest, nsmallest
4747

48-
__version__ = "3.12.4"
48+
__version__ = "3.12.5"
4949

5050
__all__ = [
5151
"anext",

asyncstdlib/_lrucache.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
from ._utility import public_module
2929

3030

31-
@public_module("asyncstdlib.functools")
31+
@public_module(
32+
"asyncstdlib.functools"
33+
) # pyright: ignore[reportArgumentType,reportUntypedClassDecorator]
3234
class CacheInfo(NamedTuple):
3335
"""
3436
Metadata on the current state of a cache

asyncstdlib/functools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ async def data(self):
233233
If the attribute is accessed by multiple tasks before a cached value has
234234
been produced, the getter can be run more than once. The final cached value
235235
is determined by the last getter coroutine to return. To enforce that the
236-
getter is executed at most once, provide a ``lock`` type - e.g. the
236+
getter is executed at most once, provide an appropriate lock type - e.g. the
237237
:py:class:`asyncio.Lock` class in an :py:mod:`asyncio` application - and
238238
access is automatically synchronised.
239239

asyncstdlib/itertools.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ async def maybe_step(self) -> None:
577577
await self.step()
578578

579579
def consume_value(self) -> T_co:
580-
"""Return the current value, after removing it from the current state"""
580+
"""Return the current value after removing it from the current state"""
581581
value, self._current_value = self._current_value, self._sentinel
582582
return value
583583

@@ -600,21 +600,21 @@ def __init__(self, target_key: R, state: "_GroupByState[R, T_co]") -> None:
600600

601601
async def __anext__(self) -> T_co:
602602
state = self._state
603+
# the groupby already advanced to another group
603604
if state.current_group is not self:
604605
raise StopAsyncIteration
605-
606606
await state.maybe_step()
607+
# the step advanced the iterator to another group
607608
if self._target_key != state.current_key:
608609
raise StopAsyncIteration
609-
610610
return state.consume_value()
611611

612612
async def aclose(self) -> None:
613-
"""Close the group iterator
613+
"""
614+
Close the group iterator
614615
615616
Note: this does _not_ close the underlying groupby managed iterator;
616617
closing a single group shouldn't affect other groups in the series.
617-
618618
"""
619619
state = self._state
620620
if state.current_group is not self:
@@ -662,8 +662,7 @@ def __init__(
662662

663663
async def __anext__(self) -> Tuple[R, AsyncIterator[T_co]]:
664664
state = self._state
665-
# disable the last group to avoid concurrency
666-
# issues.
665+
# already disable the current group to avoid concurrency issues
667666
state.current_group = None
668667
await state.maybe_step()
669668
try:

docs/source/api/functools.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ Attribute Caches
3535

3636
This type of cache tracks ``await``\ ing an attribute.
3737

38-
.. py:function:: cached_property(getter: (Self) → await T, /)
38+
.. py:function:: cached_property(getter: (Self) → await T, /) -> await T
3939
:decorator:
4040

41-
.. autofunction:: cached_property(asynccontextmanager_type: Type[AsyncContextManager], /)((Self) → await T)
41+
.. autofunction:: cached_property(context_type: Type[AsyncContextManager], /)((Self) → await T) -> await T
4242
:decorator:
4343
:noindex:
4444

4545
.. versionadded:: 1.1.0
46-
.. versionadded:: 3.13.0
46+
.. versionadded:: 3.12.5
4747

48-
The ``asynccontextmanager_type`` decorator parameter.
48+
The ``context_type`` decorator parameter.
4949

5050

5151
Callable Caches

0 commit comments

Comments
 (0)