What are the limitations of distributing .pyc files?

For example, would a file generated with Python 3.1.5 be compatible with Python 3.2.x?

No.

Or would a .pyc file generated with Python 2.7.3 be compatible with a Python 3.x release?

Doubly no.

I’m considering distributing just the .pyc files without their corresponding .py sources.

Python bytecode is high-level and trivially decompilable.

Leave a Comment