After #11671 my mypy tests fail on my use of aiofiles.tempfile.TemporaryDirectory, as described by the following test case:
from asyncio import run
from typing import reveal_type
from aiofiles.tempfile import TemporaryDirectory
async def test() -> None:
async with TemporaryDirectory() as directory_path_str:
reveal_type(directory_path_str)
print(type(directory_path_str))
if __name__ == '__main__':
run(test())
reveal_type() shows str runtime (as expected), but None during static analysis (mypy).
Environment
- Python 3.12.1
- basedmypy 2.4.0
- aiofiles 23.2.1
- types-aiofiles 23.2.0.20240331
I spent some time looking at the Typeshed and aiofiles code, but with the relevant code separated across repos, I'm having trouble finding out where the problem should be addressed exactly.
CC'ing @Tinche as the aiofiles maintainer.
After #11671 my mypy tests fail on my use of
aiofiles.tempfile.TemporaryDirectory, as described by the following test case:reveal_type()showsstrruntime (as expected), butNoneduring static analysis (mypy).Environment
I spent some time looking at the Typeshed and aiofiles code, but with the relevant code separated across repos, I'm having trouble finding out where the problem should be addressed exactly.
CC'ing @Tinche as the aiofiles maintainer.