Message345641
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(). |
|
Date |
User |
Action |
Args |
2019-06-14 21:52:04 | eric.snow | set | recipients:
+ eric.snow, brett.cannon, cheryl.sabella |
2019-06-14 21:52:04 | eric.snow | set | messageid: <1560549124.61.0.646541863019.issue23892@roundup.psfhosted.org> |
2019-06-14 21:52:04 | eric.snow | link | issue23892 messages |
2019-06-14 21:52:04 | eric.snow | create | |
|