[issue19671] Option to select the optimization level on compileall
Éric Araujo added the comment: If I understand correctly, compileall is intended as a command-line tool, but there is py_compile if you want programmatic access. Does py_compile provide functions that let you control the optimization level? -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19671 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19671] Option to select the optimization level on compileall
Sworddragon added the comment: After checking it: Yes it does, thanks for the hint. In this case I'm closing this ticket now. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19671 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19671] Option to select the optimization level on compileall
Sworddragon added the comment: Hi. Since Python 3.2, compileall functions supports the optimization level through the `optimize` parameter. 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. This is the problem: You can't pass the optimization level to compile_dir|compile_file|compile_path. What, if you want for location a .pyc files and for location b .pyo files? Or even .pyc files and .pyo files for both locations? The only solution is to make a command call within the script which is a little bit ugly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19671 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19671] Option to select the optimization level on compileall
New submission from Sworddragon: Currently on calling one of the compileall functions it is not possible to pass the optimization level as argument. The bytecode will be created depending of the optimization level of the current script instance. But if a script wants to compile .pyc files for one destination and .pyo files for another destination this will be a little tricky. -- components: Library (Lib) messages: 203533 nosy: Sworddragon priority: normal severity: normal status: open title: Option to select the optimization level on compileall type: enhancement versions: Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19671 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19671] Option to select the optimization level on compileall
Claudiu.Popa added the comment: Hi. Since Python 3.2, compileall functions supports the optimization level through the `optimize` parameter. I guess you are using Python2.7 or so? Also, there's a note in compileall's documentation regarding the command line switch for the optimization level: 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. http://docs.python.org/3.2/library/compileall.html#command-line-use -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19671 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com