Python iterators, asynchronous context managers

Asked

Viewed 85 times

0

I’m studying the asyncio module and there are some implementations of some other services that I understand but I found myself in some doubts, that would be iterators and asynchronous context managers.

I’ve seen codes like this :

async def fetch(url):
  async with aiohttp.ClientSession() as session:
    async with session.get(url) as response:
      return await response.json()

Here’s the link to the question I asked:

Error in requests with aiohttp in asyncio

How is behind the scenes the workings of them ???

  • It would be interesting to link the answer where this piece of code is to contextualize for those who have not seen it.

  • Okay. Thank you and sorry

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.