Skip to content

Commit

Permalink
fix(docs): subclass __iter__ and __aiter__ docstrings (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Sep 6, 2024
1 parent 90816c3 commit b76c1cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions a_sync/iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,13 @@ def __repr__(self) -> str:
return f"<{type(self).__name__} for {self.__wrapped__} at {hex(id(self))}>"

def __aiter__(self) -> AsyncIterator[T]:
"Returns an async iterator for the wrapped async iterable."
"""
Return an async iterator that yields :obj:`T` objects from the {cls}.
"""
return self.__wrapped__.__aiter__()

def __iter__(self) -> Iterator[T]:
"Returns an iterator for the wrapped async iterable."
"Return an iterator that yields :obj:`T` objects from the {cls}."
yield from ASyncIterator(self.__aiter__())
__slots__ = "__wrapped__",

Expand Down Expand Up @@ -416,7 +418,7 @@ def __init__(

def __aiter__(self) -> AsyncIterator[T]:
"""
Returns an async iterator for the sorted iterable.
Return an async iterator for the {cls}.
Raises:
RuntimeError: If the ASyncSorter instance has already been consumed.
Expand Down

0 comments on commit b76c1cb

Please sign in to comment.