checking pyc files against source code

Just just at xs4all.nl
Tue May 20 14:14:08 EDT 2003


In article <mailman.1053441631.21303.python-list at python.org>,
 Steven Taschuk <staschuk at telusplanet.net> wrote:

> Quoth Andrew Wilkinson:
> > I believe that Python simply looks at the date/time stamps on the files. If
> > the last modification time on the .py file is after that of the .pyc file
> > then the .pyc file is recreated.
> 
> That is so, but there's an additional check: the .pyc file
> contains (just after the magic number, if memory serves) the
> timestamp of the .py file from which it was compiled, and the file
> is recompiled if this timestamp does not match the actual
> timestamp of the .py file.

Nitpicking: it's not an additional check, it is _the_ check. The time 
stamp of the *.pyc file isn't looked at.

Just




More information about the Python-list mailing list