Skip to content

Commit

Permalink
Use Literal overloads to give better types to subprocess
Browse files Browse the repository at this point in the history
This gives better types to subprocess.check_output and subprocess.run
by laboriously overloading using literals.

To support `run`, I turned `CompletedProcess` into `_CompletedProcess[T]`
with `CompletedProcess = _CompletedProcess[Any]`. I could pretty easily
be convinced that it would be better to just make `CompletedProcess`
generic, though.

I'd like to do the same for Popen but need to make mypy support
believing the type of `__new__` in order for that to work.
  • Loading branch information
msullivan committed Jul 9, 2019
1 parent 01c2fa5 commit 5ad57e9
Showing 1 changed file with 591 additions and 17 deletions.
Loading

0 comments on commit 5ad57e9

Please sign in to comment.