CPython compiles its source code into "byte code", and for performance
reasons, it caches this byte code on the file system whenever the
source file has changes. This makes loading of Python modules much
faster because the compilation phase can be bypassed. When your source
file is foo.py , CPython caches the byte code in a foo.pyc file right
next to the source.
来自PEP 3147:
如果源代码发生变化,CPython将重新编译并重新缓存字节码。在
请注意,以上是针对
Python 2.x
。{cd2}中的{注意:当我们在这里提到“CPython”时,我们指的是您最可能从https://www.python.org使用的Python实现,因为这种行为(我相信)是特定于实现的。在
相关问题 更多 >
编程相关推荐