Terry J. Reedy <tjre...@udel.edu> added the comment:
I agree with Tim. Detect SyntaxErrors in dead code if you can, but don't change the current code deletion, at least not without proper discussion (which Pablo just started on pydev). The latter is what I consider to be a release blocker needing release manager consideration. I see optimizing away 'if __debug__: ...' clauses, when __debug__ is False (and 0) as currently documented language behavior, not a 'deep implementation detail'. https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement Assert statements are equivalent to 'if __debug__' clauses. They are optimized away when __debug__ is False, when python is run with -0. Given that False and True are 0 and 1 with extra behavior, it is not a stretch to infer that 'if 0:' clauses are optimized away, as they currently are (or were, until PR 13332). To my mind, PR 13332 is either an enhancement or a bugfix + additional regressive behavior change that I do not believe is absolutely necessary. In either case, I don't think it should have been applied as is in b2. But that is past. I think it should be either reverted or fixed before b3 to only detect SyntaxErrors without leaving code that should be removed. I don't know how close PR 14116 comes to this. ---------- nosy: +lukasz.langa, terry.reedy -Mark.Williams, p-ganssle, scoder, tim.peters priority: normal -> release blocker _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37500> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com