Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue17611>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to