+ 2

‘async’ keyword

Hi- I have seen some code on GitHub for python, and it has the async keyword before the def function keyword, so i was wondering what this meant as i am still like 15 percent done with py intermediate ❤️

11th Sep 2025, 7:50 PM
leo
leo - avatar
3 Answers
+ 3
interlinked keyword => git, git hub, py, python. async => asynchronous.,
12th Sep 2025, 12:24 AM
Asim Farheen ✴️✴️✴️🤺👿👿
Asim  Farheen ✴️✴️✴️🤺👿👿 - avatar
+ 1
async = asynchronous The function executes at different times I will come back and add more context to this but why not post this question on weblercodes.com so you can get valuable answers ?
11th Sep 2025, 9:21 PM
RuntimeTerror
RuntimeTerror - avatar
+ 1
leo, using the async keyword like this:- async def func(): means that this is an asynchronous function (or a coroutine). Unlike normal functions, an async function can pause its execution at certain points and let other tasks run in the meantime, before continuing later. See, Python, in normal cases, is executed synchronously i.e., line by line. This is fine for many tasks, but it can cause problems when your program needs to wait for something slow because, in such a fase, the program would freeze until the slow task finishes. With async code, on the other hand, Python can switch to other tasks while it’s waiting, thereby making your program faster. Basically, with async code the program kewps running while it is waiting, instead of freezing. Feel free to let mw know if you need further clarification. Thank you.
12th Sep 2025, 2:19 AM
Ushasi Bhattacharya