Skip to content

Commit 1465a68

Browse files
authored
Merge pull request #621 from esrakaya64/patch-7
Create awaitme_esra_kaya.py
2 parents c9783ae + 1cd49fb commit 1465a68

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Week05/awaitme_esra_kaya.py

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

0 commit comments

Comments
 (0)