Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Stream[T] implement AsyncIterable[T] in addition to Iterable[T] #8

Open
ebonnal opened this issue Jun 10, 2024 · 0 comments
Open
Labels
feature New feature or request, modifies library API

Comments

@ebonnal
Copy link
Owner

ebonnal commented Jun 10, 2024

An AsyncIterable[T] implements __aiter__(self) -> AsyncIterator[T]
An AsyncIterator[T] implements __anext__(self) -> T

it allows async for _ in aiterable

expected TODO:

  • Implement first async alternatives to all operation having a potentially expensive function parameter (we already have .amap/.aforeach, we need afilter...)
  • Overload the constructor: __init__(self, source: AsyncIterable[T])
  • Implement a AsyncIteratorVisitor(Visitor[AsyncIterator[T]]) that raises if non async source or non async function is involved in the stream
@ebonnal ebonnal added the feature New feature or request, modifies library API label Jun 10, 2024
@ebonnal ebonnal changed the title Make Stream[T] implement AsyncIterable[T] Make Stream[T] implement AsyncIterable[T] too Jun 10, 2024
@ebonnal ebonnal changed the title Make Stream[T] implement AsyncIterable[T] too Make Stream[T] implement AsyncIterable[T]too Jul 10, 2024
@ebonnal ebonnal changed the title Make Stream[T] implement AsyncIterable[T]too Make Stream[T] implement AsyncIterable[T] too Jul 10, 2024
@ebonnal ebonnal changed the title Make Stream[T] implement AsyncIterable[T] too Make Stream[T] implement AsyncIterable[T] in addition to Iterable[T] Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request, modifies library API
Projects
None yet
Development

No branches or pull requests

1 participant