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 serhiy.storchaka
Recipients Mark.Shannon, benjamin.peterson, ncoghlan, pitrou, serhiy.storchaka
Date 2018-03-18.13:15:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521378949.46.0.467229070634.issue32949@psf.upfronthosting.co.za>
In-reply-to
Content
Thank you for your PR Mark.

The main difference between PR 5883 and PR 5112 is that in PR 5883 the pair of old WITH_CLEANUP_FINISH and END_FINALLY are replaced with a single new WITH_CLEANUP_FINISH, and in PR 5112 it is replaced with a sequence of 7 opcodes including a new opcode RERAISE.

    POP_JUMP_IF_TRUE  L
    RERAISE
L:
    POP_TOP
    POP_TOP
    POP_TOP
    POP_EXCEPT
    POP_TOP

This doesn't affect a performance in normal case because this code is executed only when an exception has been raised (an in that case the performance is less important). And seems this doesn't introduce new race conditions.

The number of opcodes is the same in both PRs. The implementation of RERAISE in ceval.c in PR 5112 is a tiny bit simpler than the implementation of WITH_CLEANUP_FINISH in PR 5883. But the generated bytecode and the compiler are a tiny bit simpler in PR 5883. If RERAISE be used for other purposes besides implementing a "with" statement, it would be a great advantage.

For now both approaches look to me not having significant advantages or disadvantages against the other one. Does anybody have preferences?
History
Date User Action Args
2018-03-18 13:15:49serhiy.storchakasetrecipients: + serhiy.storchaka, ncoghlan, pitrou, benjamin.peterson, Mark.Shannon
2018-03-18 13:15:49serhiy.storchakasetmessageid: <1521378949.46.0.467229070634.issue32949@psf.upfronthosting.co.za>
2018-03-18 13:15:49serhiy.storchakalinkissue32949 messages
2018-03-18 13:15:49serhiy.storchakacreate