> On Nov 28, 2021, at 3:03 PM, Serhiy Storchaka <storch...@gmail.com> wrote: > > 28.11.21 17:13, Skip Montanaro пише: >>> That is not entirely true: >>> https://github.com/python/cpython/pull/29639#issuecomment-974146979 >> >> The only places I've seen "if 0:" or "if False:" in live code was for >> debugging. Optimizing that hardly seems necessary. In any case, the >> original comment was about comparisons of two constants. I suppose >> sweeping up all of that into a constant expression folding/elimination >> step performed on the AST and/or during peephole optimization would >> cover both cases. > > "if 0:" and "if False:" is already optimized by the compiler. The OP > proposes to optimize "2 < 1", and I cannot imagine any use case for this.
I agree. I suggest we don’t add this optimization. Eric _______________________________________________ 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/JP6FF2RHDQSIOS6ZAI45S7X6UXWGPBKR/ Code of Conduct: http://python.org/psf/codeofconduct/