This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients brett.cannon, cheryl.sabella, eric.snow
Date 2019-06-14.21:52:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560549124.61.0.646541863019.issue23892@roundup.psfhosted.org>
In-reply-to
Content
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().
History
Date User Action Args
2019-06-14 21:52:04eric.snowsetrecipients: + eric.snow, brett.cannon, cheryl.sabella
2019-06-14 21:52:04eric.snowsetmessageid: <1560549124.61.0.646541863019.issue23892@roundup.psfhosted.org>
2019-06-14 21:52:04eric.snowlinkissue23892 messages
2019-06-14 21:52:04eric.snowcreate