Message298934
So, the approach of duplicating finally blocks tends to lead to a non-trivial bytecode increase. There is even a potential combinatorial explosion with nested "try..finally" block:
def f():
try:
...
finally:
try:
...
finally:
# etc.
Such a chain of N nested "finally"s will emit O(2**N) opcodes.
I'm not sure it's a pratical concern but I find it is detrimental to the readibility of bytecode (which is a nice thing to have when doing low-level debugging or tweaking). I think we can massage the PR to remove the "finally" block duplication while keeping the predictable stack effect. |
|
Date |
User |
Action |
Args |
2017-07-24 08:09:05 | pitrou | set | recipients:
+ pitrou, nascheme, rhettinger, mark.dickinson, vstinner, christian.heimes, benjamin.peterson, trent, Mark.Shannon, serhiy.storchaka, Demur Rumed |
2017-07-24 08:09:05 | pitrou | set | messageid: <1500883745.86.0.991732879843.issue17611@psf.upfronthosting.co.za> |
2017-07-24 08:09:05 | pitrou | link | issue17611 messages |
2017-07-24 08:09:05 | pitrou | create | |
|