Skip to content

Commit 4911277

Browse files
authored
Create awaitme_eren_malkoc.py
1 parent 5bc68e2 commit 4911277

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Week05/awaitme_eren_malkoc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import asyncio
2+
3+
def awaitme(fn):
4+
async def wrapper(*args, **kwargs):
5+
result = fn(*args, **kwargs)
6+
if asyncio.iscoroutine(result):
7+
return await result
8+
else:
9+
return result
10+
11+
return wrapper

0 commit comments

Comments
 (0)