pyc files are the bytecode complied version of normal .py files.
They're kept around so that the interpreter doesn't have to re-parse
the file every time it tries to load a module. Since eggs are not
usually intended to be worked with directly, it makes sense to
bytecode compile the source files in order to make module loading
faster.
At least, that's why I think eggs would be full of .pyc files. That
and the million messages 'bytecode compiling foo.py' when you
bdist_egg.
Sorry, I just couldn't resist! :-)
No problem... But hey, is there any apple.py there? :-P
--
Jorge Godoy <jgo...@gmail.com>
At least, that's why I think eggs would be full of .pyc files. That
and the million messages 'bytecode compiling foo.py' when you
bdist_egg.
The target for a Python compilation is the Python virtual machine, so
on any physical machine, a given version of CPython should generate the
same bytecode. If it doesn't, it's a bug. :-)
> also aren't .pyc files platform dependant?
No--they're platform independent, because they are comprised of opcodes
for the Python virtual machine. They are definitely
implementation-dependent (CPython only) and version-dependent (.pycs
compiled with one version of CPython will not work with another
version), though,
--
Tim Lesher
tle...@gmail.com
> yes but i think that will optimice for your machine.
The target for a Python compilation is the Python virtual machine, so
on any physical machine, a given version of CPython should generate the
same bytecode. If it doesn't, it's a bug. :-)
> also aren't .pyc files platform dependant?
No--they're platform independent, because they are comprised of opcodes
for the Python virtual machine. They are definitely
implementation-dependent (CPython only) and version-dependent (.pycs
compiled with one version of CPython will not work with another
version), though,
If you mean the Python bytecode compiler, then yes... otherwise, it
shouldn't matter what C compiler you used to compile Python itself--if
it does, then there's a bug in Python (or the C compiler).
Within the same version release of Python, bytecode is bytecode. What
you can't do, for example, is take a Python 2.4 .pyc and expect it to
work correctly under Python 2.2, or vice-versa.
--
Tim Lesher <tle...@gmail.com>