Why does python print version info to stderr?

前端 未结 2 1662
攒了一身酷
攒了一身酷 2020-11-30 09:10

Why did Guido (or whoever else) decide to make python --version print to stderr rather than stdout? Just curious what the use case is that makes standard error

2条回答
  •  孤街浪徒
    2020-11-30 09:34

    Python 3.4 was modified to output to stdout, which is the expected behavior. This is listed as a bug with Python here: http://bugs.python.org/issue18338. The comments on the bug report indicate that while stdout is the reasonable choice, it would break backward compatibility. Python 2.7.9 is largely unchanged, because so much relies on it.

    Hope that helps!

提交回复
热议问题