Python bytecode compatibility between interpreter versions

Jon Perez jbperez808 at yahoo.com
Sun Mar 21 21:28:11 EST 2004


Roger Binns wrote:

> Nope.  They are an implementation specific thing.  The interpretter
> puts version and other information in them, and regenerates them
> on the fly.  
 >
 > There is nothing wrong with an interpretter deciding
 > to regenerate them every single day in a different format, or
 > based on the moon phase, or your login id or anything else.

So we can't even count on the fact that Python 2.2 running under Windows
on an Athlon will generate a .pyc file that's identical with that
generated by the exact same version (2.2) of the interpreter running
under Linux on, say, a Pentium III, and further, is not even *guaranteed*
to run on it?!?

This does not seem to fit in with what I've been reading... it would
be a lot more logical (and convenient) if we can count on .pyc portability
across different _patch versions_ (.x.y) of the same minor version (.x)
of CPython on whatever platform it is running on, and I believe that
Python's contributors would make an effort to ensure that this is the case.




More information about the Python-list mailing list