I have a bunch of code with the same pattern:
def process(iterable): if inspect.isasyncgen(iterable): return process_async(iterable) else: