Eric Snow <ericsnowcurren...@gmail.com> added the comment:
There are (solvable) problems with my original recommendation: 1. sys.implementation is by definition not suitable for third-party import hooks to modify + it is set during the Python implementation during runtime init + it is effectively read-only after that 2. "opt_levels" is too specific to the CPython status quo + there are other ways to encode the optimizations of a bytecode file [1] + "optimizations" would probably be more correct + that opens a whole can of worms (e.g. what does sys.flags.optimize mean) So we may want to think this over a bit before going any further. I'm going to collect my thoughts on this and write more later. :) [1] In PEP 488 it says: It is expected that beyond Python's own two optimization levels, third-party code will use a hash of optimization names to specify the optimization level, e.g. hashlib.sha256(','.join(['no dead code', 'const folding'])).hexdigest(). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue23892> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com