From b8fb6c406d64c86644deb60c0b8e11a141698e1a Mon Sep 17 00:00:00 2001 From: Onur Konuk <95957528+onurkonukk@users.noreply.github.com> Date: Sun, 5 Jan 2025 08:26:00 +0300 Subject: [PATCH] Create awaitme_onur_konuk.py --- Week05/awaitme_onur_konuk.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Week05/awaitme_onur_konuk.py diff --git a/Week05/awaitme_onur_konuk.py b/Week05/awaitme_onur_konuk.py new file mode 100644 index 00000000..ad22e180 --- /dev/null +++ b/Week05/awaitme_onur_konuk.py @@ -0,0 +1,9 @@ +import asyncio + +def awaitme(func): + async def wrapper(*args, **kwargs): + result = func(*args, **kwargs) + if asyncio.iscoroutine(result): + return await result + return result + return wrapper