diff --git a/Week05/Week05/awaitme_firat_adar_dal.py b/Week05/Week05/awaitme_firat_adar_dal.py new file mode 100644 index 00000000..09e2163a --- /dev/null +++ b/Week05/Week05/awaitme_firat_adar_dal.py @@ -0,0 +1,12 @@ +import asyncio + +def awaitme(func): + """Decorator to handle both synchronous and asynchronous functions.""" + + async def _wrapper(*args, **kwargs): + result = func(*args, **kwargs) + if asyncio.iscoroutine(result): + return await result + return result + + return _wrapper