How can I require that an abstract base class implement a specific method as a coroutine. For example, consider this ABC:
import abc
class Foo(abc.ABC):
@abc.abstractmethod
async def func():
pass
Now when I subclass and instantiate that:
class Bar(Foo):
def func():
pass
b = Bar()
This succeeds, although func
is not async
, as in the ABC. What can I do so that this only succeeds if func
is async
?