diff --git a/Week05/awaitme_berra_soyler.py b/Week05/awaitme_berra_soyler.py new file mode 100644 index 00000000..05bdcce8 --- /dev/null +++ b/Week05/awaitme_berra_soyler.py @@ -0,0 +1,12 @@ +import asyncio + +def awaitme(func): + async def wrap(*args, **kwargs): + result = func(*args, **kwargs) + + if asyncio.iscoroutine(result): + return await result + else: + return result + + return wrap