python-trio / trio-typing

Type hints for Trio and related projects
Other
27 stars 14 forks source link

Infer presence/absence of trio.Process stream attributes based on constructor arguments #12

Open oremanj opened 5 years ago

oremanj commented 5 years ago

If you say trio.Process(..., stdin=DEVNULL, stdout=DEVNULL, stderr=PIPE), then you know that the stdin/stdout attributes on the resulting Process object are None and the stderr attribute is not None. If the plugin could let mypy understand this, it would save a bunch of unnecessary assertions.