dabeaz / curio

Good Curio!
Other
4.04k stars 243 forks source link

Async generator method not supported in asyncABC #217

Closed crubier closed 5 years ago

crubier commented 7 years ago

Async-correctness validation using curio.meta.asyncABC does not work for async generators.

Example:

class Parent(asyncABC):
    @abstractmethod
    async def foo(self):
        raise NotImplementedError

class Child(Parent):
    async def foo(self):
        yield 1
        return

This raises the following error:

TypeError: Must use async def foo(self)

Which is already the case ! (But of course foo is not a coroutine but an async @generator)

This is probably due to the fact that asyncABC search for coroutines, when it should actually check for coroutines and async generators