async_generator icon indicating copy to clipboard operation
async_generator copied to clipboard

Making it easy to write async iterators in Python 3.5

Results 9 async_generator issues
Sort by recently updated
recently updated
newest added

Now that Python 3.6 reached EOL, I believe this library does more harm than good and we should deprecate it and eventually archive it. What do you think?

I was expecting something like the following example to work, but it does not. This originally came up in: https://github.com/tiangolo/fastapi/issues/1204 ```python from async_generator import asynccontextmanager class GenClass: async def __call__(self):...

Mainly to clarify that the async generator and async context manager examples are actually two different examples, since Ninpo found this confusing. But then once I started editing I of...

Workaround for https://bugs.python.org/issue33786 that wasn't backported until python 3.7.9: https://github.com/python/cpython/commits/13c94747c74437e594b7fc242ff7da668e81887c.

Python version: `Python 3.7.6+ (heads/3.7:b0a6ec256b)` OS: `macOS 10.14.6` `async_generator.asynccontextmanager` started to fail in python [`3.7-dev`](https://github.com/python/cpython/commits/3.7)(which is also the `3.7-dev` in `pyenv`). If we change to use `contextlib.asynccontextmanager`, it works. It's...

I have an abstract class that defines an abstract async context manager (Python 3.7 code): ```python import abc import contextlib class Foo(metaclass=abc.ABCMeta): @abc.abstractmethod @contextlib.asynccontextmanager async def bar(self): pass ``` In...

Instead of trying to explicitly construct AsyncGenValueWrapper objects, trick the interpreter into doing the wrapping and unwrapping for us. There's still some ctypes hackery involved, but it's much less finicky:...

This improves performance and offers cleaner tracebacks, although native generators continue to have the failure mode of https://bugs.python.org/issue32526 and to provide not-very-clear exception messages when they're misused. Since the semantics...