.pyc files with different optimization level have the same content, use hard links to consolidate duplicate files.
Changed in version 3.2: Added the
Changed in version 3.5: Added the
-q option was changed to a multilevel value.
-b will always produce a byte-code file ending in
Changed in version 3.7: Added the
Changed in version 3.9: Added the
--hardlink-dupes options. Raised the default recursion limit from 10 to
sys.getrecursionlimit(). Added the possibility to specify the
-o option multiple times.
There is no command-line option to control the optimization level used by the
compile() function, because the Python interpreter itself already provides the option: python -O -m compileall.
compile() function respects the
sys.pycache_prefix setting. The generated bytecode cache will only be useful if
compile() is run with the same
sys.pycache_prefix (if any) that will be used at runtime.