typeshed
typeshed copied to clipboard
pexpect: PopenSpawn() env arg hint could be improved
Currently the hint says that env is os._Environ[str] | None, but in practice it's not as specific. It's passed unmodified to subprocess.Popen, so maybe it should simply be subprocess._ENV if that's possible and allowed.
Using subprocess._ENV makes the most sense to me. This will also mean that future improvements to the typing of subprocess will automatically be inherited by pexpect. PR welcome!