Open
Description
Is it possible to update asyncio
stub files so that asyncio.Process.{stdin,stdout,stderr}
are resolved as non-None by mypy?
Example:
from asyncio import create_subprocess_exec
from asyncio.subprocess import PIPE
async def main() -> None:
proc = await create_subprocess_exec('/usr/bin/ls', stdout=PIPE)
async for line in proc.stdout:
print(line)
Typing error reported by mypy (desired behaviour is no error):
error: Item "None" of "StreamReader | None" has no attribute "__aiter__" (not async iterable) [union-attr]
Current asyncio.Process
declaration in typeshed/stdlib/asyncio/subprocess.pyi:
class Process:
stdin: streams.StreamWriter | None
stdout: streams.StreamReader | None
stderr: streams.StreamReader | None