Terry J. Reedy added the comment: (2.6 is security fix only)
Stripping truly dead code after return is really tricky in general because a) it might be in a conditional block, and b) unreachable yield and assignment can affect compilation. Assignments that make names local are detected on a first pass, but I do not know about yield. Anyway, I believe the policy has been to not do it. The final patch will need a cpython-only test based on g(x), with dead code. Possibly intersecting issues are proposals to change where optimization is done and, for testing, to add a generator to dis so its output can be directly captured and analyzed instead of having to redirect, capture, and parse stdout. ---------- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, terry.reedy stage: -> patch review type: -> behavior versions: -Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16619> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com