> (2) I don't see `redirect_stdio(stout=None ...)` as meaning "leave 
> stdout alone". I see it as equivalent to some variation of unsetting 
> stdout, say setting it to /dev/null.

This makes sense, perhaps None could be an alias for a stream created from 
os.devnull [1]. Then the default arguments for stdin, stdout, stderr would be 
sys.stdin, sys.stdout and sys.stderr respectively.

I've now created a GitHub issue [2] and a draft PR [3] for 
contextlib.redirect_stdin.

[1]: https://docs.python.org/3/library/os.html#os.devnull
[2]: https://github.com/python/cpython/issues/92178
[3]: https://github.com/python/cpython/pull/92180
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/35P76FP2H7Y72Q4BMOG7YRVR53LUQWCY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to