I found a Loop for
with a somewhat different syntax, I tried to find out how it worked but I couldn't, it gave me an error.
I began to investigate but I did not find much information, according to its syntax it is an for
"asynchronous" loop or something like that, this would be the loop for
I am talking about:
async for target in iter:
block
Well my question is what is this loop for for
? How does it work? And under what circumstances should it be used?
I also realized that there is not only a loop for
with that different syntax( async
), there are functions, withs
and I don't know if there are more.
async def funcname(parameter_list):
pass
async with expr as var:
block
So why async
before declaring a loop for
, a function, etc?
Thanks in advance for your answers!