diff --git a/Week05/awaitme_basak_kocan.py b/Week05/awaitme_basak_kocan.py new file mode 100644 index 00000000..ba7726aa --- /dev/null +++ b/Week05/awaitme_basak_kocan.py @@ -0,0 +1,9 @@ +import asyncio + +def awaitme(fn): + async def wrapper(*args, **kwargs): + result = fn(*args, **kwargs) + if asyncio.iscoroutine(result): + return await result + return result + return wrapper