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.

_______________________________________________
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/ZJPTMHWPTPWC6Q4ZKWJB5CY6LURQ75PM/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to