Gregory P. Smith added the comment:

This would avoid the need to modify an interpreter to have this optimization.  
In this mode the potentially expensive stat() call is avoided.  No need to 
ensure that the pyc file's embedded timestamp matches the py file's timestamp.  
The only use of this mode would be when that is guaranteed by a build system so 
loading modules continues to be fast without reverting to loading the py when 
the pyc is already known good.

Our specific example is a build system that generates pyc's for some py files 
at build time but timestamps of files are not maintained at all through the 
build/packaging/distribution process because they are seen an irrelevant detail 
and not even kept track of by the build.  Python is fairly unique in wanting to 
depend upon file timestamp metadata as a form of input data going from py -> 
pyc.

Right now we work around the problem by not having py files available at all in 
this situation.  Using .pycs greatly speeds up the program's load time, but not 
having source code around makes for worse tracebacks and causes problems with 
other tools which need to use the source.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23723>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to