typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

pexpect: PopenSpawn() env arg hint could be improved

Open wRAR opened this issue 2 months ago • 1 comments

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.

wRAR avatar Oct 24 '25 14:10 wRAR

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!

srittau avatar Oct 30 '25 20:10 srittau