From 491127776c7091e90e35646456d3483bfef82c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20Malko=C3=A7?= <105520516+erenmalkoc@users.noreply.github.com> Date: Sat, 26 Oct 2024 16:44:34 +0300 Subject: [PATCH] Create awaitme_eren_malkoc.py --- Week05/awaitme_eren_malkoc.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Week05/awaitme_eren_malkoc.py diff --git a/Week05/awaitme_eren_malkoc.py b/Week05/awaitme_eren_malkoc.py new file mode 100644 index 00000000..305bd4ba --- /dev/null +++ b/Week05/awaitme_eren_malkoc.py @@ -0,0 +1,11 @@ +import asyncio + +def awaitme(fn): + async def wrapper(*args, **kwargs): + result = fn(*args, **kwargs) + if asyncio.iscoroutine(result): + return await result + else: + return result + + return wrapper