On Wed, Feb 3, 2010 at 1:52 PM, Christoph Zwerschke <c...@online.de> wrote:

> Isn't that the expected behavior?
>

Egad, no.  That compiled file is only a valid substitute for the exact
source from which it was compiled.


> Only now I notice you expect a recompilation when the timestamp is
> *different*, not only when it is *younger*. But I believe the latter is
> also the behavior of Python concerning .pyc files.


No.  Python only uses the .pyc if there is an exact timestamp match.  The
.pyc contains the mtime of the corresponding .py file at the time of
compilation.  If that mtime stored in the .pyc file doesn't match the mtime
of the .py file, python recompiles:

http://docs.python.org/tutorial/modules.html#compiled-python-files

Ideally, python would compute some one-way hash of the source and only use
the .pyc if the hash matches, but the mtime trick is nearly as good
practically speaking and much, much faster.

Otherwise, what if compilation takes some seconds?
>

As opposed to running the wrong code?

Cheers,

Jason

-- 
Jason Rennie
Research Scientist, ITA Software
617-714-2645
http://www.itasoftware.com/
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to