On Feb 8, 2008, at 11:42 AM, Ivan Voras wrote:
I'm not a python guru by any means, but I think .pyc files probably have data
about the .py they are generated from because there's some sort of
auto-generation available. It may be possible to not store them at all and just generate them before you use them or add some magic build flags to cause them to store some sort of cooked values. I'm not sure where the .pyo files
come from.

.pyc/.pyo contain at least the timestamp of the original .py file and maybe a compilation timestamp. You can indeed safely delete all .pyc and .pyo files and forget about them - the only penalty will be slightly slower application startup times as the .py files are compiled every time.

Yep, that's right.

.pyo are optimized version of .pyc. AFAIK currently the optimizations are not worth it.

Historically, the Python optimizer wasn't capable of doing much, true, but the more recent versions of the optimizer can actually do some peephole optimizations like algorithmic simplification and constant folding:

http://docs.python.org/whatsnew/other-lang.html#SECTION0001320000000000000000

--
-Chuck

_______________________________________________
freebsd-performance@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-performance
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to