Message384721
For extra fun, you can add `break` and `continue` paths into the mix to get a 5-fold instead of 3-fold code size increase per level of nesting. It's still contrived code, though.
Example where do_cleanup() ends up with 5**4 = 625 paths:
----
def f():
while True:
try:
if something(): break
elif something_else(): continue
elif yet_something_else(): return
finally:
try:
if something(): break
elif something_else(): continue
elif yet_something_else(): return
finally:
try:
if something(): break
elif something_else(): continue
elif yet_something_else(): return
finally:
try:
if something(): break
elif something_else(): continue
elif yet_something_else(): return
finally:
do_cleanup()
---- |
|
Date |
User |
Action |
Args |
2021-01-09 12:19:47 | mark.dickinson | set | recipients:
+ mark.dickinson, Mark.Shannon |
2021-01-09 12:19:47 | mark.dickinson | set | messageid: <1610194787.38.0.499632365338.issue42873@roundup.psfhosted.org> |
2021-01-09 12:19:47 | mark.dickinson | link | issue42873 messages |
2021-01-09 12:19:47 | mark.dickinson | create | |
|