On Mon, Nov 29, 2021 at 12:32:19PM +0000, Mark Shannon wrote: > Hi, > > I am surprised by the insistence on this thread for excluding comparisons > from constant folding. > Why should we special case comparisons? Am I missing something here?
We[1] are worried that the benefit gained will not be worth the maintenance burden of constant folding comparisons. Unlike constant-folding arithmetic expressions, the benefit for comparisons is small: code that compares two literals e.g. `3 < 5` is probably very rare, outside of tests. So this will help almost nobody, but still require maintenance. (And the tests will need to be changed, if we add this, otherwise they will only be testing the keyhole optimizer, not the runtime comparison!) I have no idea of how much maintenance the keyhole optimizer requires. We have a volunteer willing to do the work (Jeremy). Do we have a core developer willing to review their work, and mentor them if if it is not up to standard? If not, then this conversation will go nowhere. [1] That's an editorial "we". Personally, I don't have an opinion one way or another :-) -- Steve _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/MUL7KTCPUGBTYZF4AXYI5UDE7UIC5ANR/ Code of Conduct: http://python.org/psf/codeofconduct/