我刚在我的 Macintosh 上注意到了这一点。运行 $ python
会启动一个解释器会话,并显示以下内容:
$ python2.7
Python 2.7.10 (default, Feb 6 2017, 23:53:20)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
启动文本的第二行提到了GCC和Clang版本。
这两者与Python解释器有什么关系?考虑到Python是一种解释型语言,根本不应该提及编译器,因此我很好奇为什么会显示这个信息。
现在是Python3.6的情况:
$ python3.6
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
这次没有提及clang,为什么呢?