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 mark.dickinson
Recipients Mark.Shannon, mark.dickinson
Date 2021-01-09.12:19:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610194787.38.0.499632365338.issue42873@roundup.psfhosted.org>
In-reply-to
Content
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()
----
History
Date User Action Args
2021-01-09 12:19:47mark.dickinsonsetrecipients: + mark.dickinson, Mark.Shannon
2021-01-09 12:19:47mark.dickinsonsetmessageid: <1610194787.38.0.499632365338.issue42873@roundup.psfhosted.org>
2021-01-09 12:19:47mark.dickinsonlinkissue42873 messages
2021-01-09 12:19:47mark.dickinsoncreate