What does GCC have to do with a python interpreter?

后端 未结 1 993
清歌不尽
清歌不尽 2020-12-18 23:58

I just noticed this on my macintosh. Running $ python fires up an interpreter session with the following lines:

$ python2.7
Python 2.7.10 (defau         


        
相关标签:
1条回答
  • 2020-12-19 00:31

    The CPython interpreter is itself written in C. It matters what compiler was used to convert the C code into a binary executable; behaviour and performance can differ in subtle ways, so it is mentioned in the banner.

    You have two different Python binaries, the differences in the banner reflect differences in how those binaries where built. Since the Python 2.7 release is the one that comes bundled with OS X, it was built by Apple engineers using a different toolchain (using the clang compiler) from the Python 3.6 installation, which you must have installed separately (OS X doesn't include Python 3.6 yet). The latter was compiled with the GCC compiler.

    0 讨论(0)
提交回复
热议问题