Demur Rumed added the comment: Attached is a patch which fixes test_sys_settrace & test_pdb & test_trace. Still failing is test_genexps. I'm unsure the best way to fix this one:
1. Allow generator expressions to defer type errors about non iterables until the initial call to next 2. Create a TEST_ITER opcode entirely for generator expressions to eagerly throw 3. Generate instructions like FOR_BEGIN, if empty, jump over generator & put an empty generator on the stack -> CALL_FUNCTION 2, have generator produce code as LOAD_FAST 0, LOAD_FAST 1, <code>, FOR_ITER repeat <code> (ie translate stack of FOR_BEGIN from before call as header of generator) Empty generator can be created with 'LOAD_CONST (None,), FOR_BEGIN, POP' but it seems rather bad to have generators require 3 more opcodes around their creation than currently ---------- Added file: http://bugs.python.org/file43270/forbegin2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27127> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com