title: Attach data to running event loop
body: <p>I would like to attach some data to a currently running loop. This can be very useful in sharing secret keys, or reusing sessions. For example, something like</p>
  
  <pre class="lang-py prettyprint-override"><code>import asyncio
  import aiohttp
  
  async def func1():
    loop=asyncio.get_running_loop()
    loop["client_session"] = aiohttp.ClientSession()
  
  async def func2():
    loop=asyncio.get_running_loop()
    return await loop["client_session"].get("https://google.com")
  
  async def main():
    await func1()
    return await func2()
  
  if __name__ == "__main__":
    asyncio.run(main())
  </code></pre>
  
  <p>My question is, would the above code work, is it reliable, or is there a better way?</p>
  
  <p>I know that data can be attached to an <code>aiohttp.Application</code>, and so I'm wondering if the same can be done for general asyncio loops.</p>