[issue23892] Introduce sys.implementation.opt_levels

2019-06-14 Thread Eric Snow


Eric Snow  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23892] Introduce sys.implementation.opt_levels

2019-06-14 Thread Eric Snow


Eric Snow  added the comment:

(Sorry for taking so long!)

Thanks for doing this, Cheryl!  I'm leaving a review on your PR. :)

Also, in PEP 421 it says that you need a PEP for this. [1]  "Such a PEP need 
not be long, just long enough."  (I just realized that the requirement isn't 
obvious so I've opened issue #37284.)


[1] https://www.python.org/dev/peps/pep-0421/#adding-new-required-attributes

--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23892] Introduce sys.implementation.opt_levels

2018-10-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Brett, I know you're away this month, so please ignore this,

Eric, I hope the changes I made reflect your original intent in the code review 
for #23731.


This is my first change to the C code, so I hope it's close.  The tests passed, 
so it must be correct.  ;-)  [j/k]

--
nosy: +cheryl.sabella
versions: +Python 3.8 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23892] Introduce sys.implementation.opt_levels

2018-10-12 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +9201
stage: test needed -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23892] Introduce sys.implementation.opt_levels ?

2015-04-08 Thread Brett Cannon

New submission from Brett Cannon:

Eric suggested in a code review for issue #23731 that maybe we should have the 
possible optimization levels listed somewhere.

--
components: Library (Lib)
messages: 240286
nosy: brett.cannon, eric.snow
priority: low
severity: normal
stage: test needed
status: open
title: Introduce sys.implementation.opt_levels ?
type: enhancement
versions: Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23892
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23892] Introduce sys.implementation.opt_levels

2015-04-08 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
dependencies: +Implement PEP 488
title: Introduce sys.implementation.opt_levels ? - Introduce 
sys.implementation.opt_levels

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23892
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com