From PEP 3147 :
CPython compiles the 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 greatly improves the loading of Python modules faster because the compilation phase can be bypassed. When your source file is foo.py, CPython caches the byte code in the right foo.pyc next to the source.
If your source is changing; CPython will recompile and re-cache the bytecode.
Please note that the above is for Python 2.x. All this changed in Python 3.xin Python 3.2: PEP 3147: PYC Repository Directories
.. "CPython" , Python, , , https://www.python.org, ( ) .