From c4d341fc6fd78a843bbbf35f683e35d6cd02cdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C3=87olako=C4=9Flu?= <130840093+mertcolakoglu@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:27:57 +0300 Subject: [PATCH] Implement awaitme decorator for coroutine support Added a decorator to convert functions into coroutines. --- Week05/awaitme_mert_colakoglu.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Week05/awaitme_mert_colakoglu.py diff --git a/Week05/awaitme_mert_colakoglu.py b/Week05/awaitme_mert_colakoglu.py new file mode 100644 index 00000000..10d4a283 --- /dev/null +++ b/Week05/awaitme_mert_colakoglu.py @@ -0,0 +1,13 @@ +def awaitme(func): + """ + A decorator that turns any function into a coroutine. + + :param func: The function to be decorated. + :type func: callable + :return: An asynchronous wrapper of the function. + :rtype: callable + """ + async def _awaitme(*args, **kwargs): + return func(*args, **kwargs) + + return _awaitme