Author nascheme
Recipients Demur Rumed, Mark.Shannon, benjamin.peterson, christian.heimes, mark.dickinson, nascheme, ncoghlan, pitrou, rhettinger, serhiy.storchaka, trent
Date 2017-12-23.21:21:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514064063.98.0.213398074469.issue17611@psf.upfronthosting.co.za>
In-reply-to
Content
Ho ho ho!   I spent some time to try to resolve the remaining issues with PR 4682.  I think everything now works.  Returns from a final body of a try/finally was the remaining issue.  I've solved it by introducing the POP_NO_EXCEPT opcode.  I added a number of comments to help explain to future maintainers what is going on.

The PR still could use some polishing.  I have some test cases to add, to trigger the previously buggy try/finally + return case.  Also, I think the fblock_unwind_<block type> functions in the compiler could be done more simply.  I don't think we need a separate function for each type, just use a case statement on the fblock type.  That's a fairly minor detail though.

I would also like to add a bunch more comments.  I've spent many hours figuring out how all this stuff works, not that I totally understand everthing.   The test case test_contextlib test_exit_exception_with_existing_context() was especially brain-busting.  I'm a bit horrified that Python has become so complex to support such things.

Anyhow, I'm off for holidays so no time for further polish until after Christmas.
History
Date User Action Args
2017-12-23 21:21:04naschemesetrecipients: + nascheme, rhettinger, mark.dickinson, ncoghlan, pitrou, christian.heimes, benjamin.peterson, trent, Mark.Shannon, serhiy.storchaka, Demur Rumed
2017-12-23 21:21:03naschemesetmessageid: <1514064063.98.0.213398074469.issue17611@psf.upfronthosting.co.za>
2017-12-23 21:21:03naschemelinkissue17611 messages
2017-12-23 21:21:03naschemecreate