Skip to content

Commit

Permalink
usage note
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfischer2781 committed Jan 5, 2024
1 parent 20776b1 commit b12a142
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion asyncstdlib/_core.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""
Internal helpers to safely build async abstractions
While some of these helpers have public siblings
(e.g. :py:class:`~.ScopedIter` and :py:func:`~.asynctools.scoped_iter`)
they are purposely kept separate.
Any helpers in this module are *not* bound to maintaining a public interface,
and offer less convenience to save on overhead.
"""
from inspect import iscoroutinefunction
from typing import (
Any,
Expand Down Expand Up @@ -55,7 +64,12 @@ async def _aiter_sync(iterable: Iterable[T]) -> AsyncIterator[T]:


class ScopedIter(Generic[T]):
"""Context manager that provides and cleans up an iterator for an iterable"""
"""
Context manager that provides and cleans up an iterator for an iterable
Note that unlike :py:func:`~.asynctools.scoped_iter`, this helper does
*not* borrow the iterator automatically. Use :py:func:`~.borrow` if needed.
"""

__slots__ = ("_iterator",)

Expand Down

0 comments on commit b12a142

Please sign in to comment.