Benjamin Peterson <benja...@python.org> added the comment: You should remove the error logic compile.c for "return" and "yield" in function calls.
The problem with this approach is that every SyntaxError generated during bytecode compilation must be moved to earlier. For example, I can still use "break" and "continue" outside loops with your patch. The only way I can think of around this is to compile the block anyway and remove the extra code later. Maybe this optimization could be moved to the peep holer? _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1875> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com