[Python-Dev] Re: Optimizing literal comparisons and contains

2021-11-27 Thread raymond . hettinger
For the benefit of the audience on python-dev, you should also mention that this proposal and associated PR has been twice discussed and rejected on the tracker: https://bugs.python.org/issue45907 https://bugs.python.org/issue45843 The response just given by Skip pretty much matches the

[Python-Dev] Re: The current state of typing PEPs

2021-11-27 Thread Christopher Barker
On Fri, Nov 26, 2021 at 5:47 PM Jim J. Jewett wrote: > Steven D'Aprano wrote: > > Maybe PEP 563 could include a decorator in the typing module to > > destringify all the annotations in a class or function? > > If it were in an annotations module, that would probably be sufficient. > > If it is

[Python-Dev] Re: Optimizing literal comparisons and contains

2021-11-27 Thread Skip Montanaro
> Many operations involving two literals are optimized (to a certain level). So > it sort of surprises me that literal comparisons are not optimized and > literal contains only convert the right operand to a constant if possible. > I'd like to implement optimizations for these especially for

[Python-Dev] Optimizing literal comparisons and contains

2021-11-27 Thread Jeremiah Vivian
Many operations involving two literals are optimized (to a certain level). So it sort of surprises me that literal comparisons are not optimized and literal contains only convert the right operand to a constant if possible. I'd like to implement optimizations for these especially for the