This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Demur Rumed
Recipients Demur Rumed, dino.viehland, serhiy.storchaka
Date 2016-06-07.03:55:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465271739.5.0.938317507323.issue27127@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2016-06-07 03:55:39Demur Rumedsetrecipients: + Demur Rumed, dino.viehland, serhiy.storchaka
2016-06-07 03:55:39Demur Rumedsetmessageid: <1465271739.5.0.938317507323.issue27127@psf.upfronthosting.co.za>
2016-06-07 03:55:39Demur Rumedlinkissue27127 messages
2016-06-07 03:55:39Demur Rumedcreate