TypeError when unpacking dictionary values in Python 3.10 with AsyncIO
I need some guidance on I'm working with a `TypeError` when trying to unpack values from a dictionary within an asynchronous function. I'm using Python 3.10 and the `asyncio` library to fetch data from an API. Here's the relevant part of my code: ```python import asyncio import aiohttp async def fetch_data(url): async with aiohttp.ClientSession() as session: async with session.get(url) as response: return await response.json() async def process_data(): url = 'https://api.example.com/data' data = await fetch_data(url) for key, value in data.items(): # This line throws TypeError print(f'Key: {key}, Value: {value}') asyncio.run(process_data()) ``` The API returns a JSON object, which I expect to be a dictionary. However, I'm seeing the following behavior: ``` TypeError: want to unpack non-iterable NoneType object ``` I checked the response and confirmed that it is indeed a valid JSON object when printed out. I tried adding print statements just before the unpacking line to inspect the `data` variable. It seems to have a valid structure initially but appears to be `None` right before the unpacking occurs. I've verified that the URL is correct and the API responds as expected. What could be causing the unpacking to unexpected result? Is there something I'm missing in the async behavior or the way I'm handling the response?