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 BTaskaya, Mark.Shannon, eric.smith, ethan.furman, lukasz.langa, pablogsal, ppperry, serhiy.storchaka, vstinner, xtreak
Date 2019-08-13.16:09:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565712586.33.0.412989984265.issue37830@roundup.psfhosted.org>
In-reply-to
Content
Batuhan, unfortunately your second solution does not work too, because continue and break can be conditional. For example:

def simple(x):
    for number in range(2):
        try:
            return number
        finally:
            if x:
                continue

print(simple(0))
print(simple(1))

It should print:

0
None


Ethan, your understanding is correct.
History
Date User Action Args
2019-08-13 16:09:46serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, eric.smith, ethan.furman, lukasz.langa, Mark.Shannon, ppperry, pablogsal, xtreak, BTaskaya
2019-08-13 16:09:46serhiy.storchakasetmessageid: <1565712586.33.0.412989984265.issue37830@roundup.psfhosted.org>
2019-08-13 16:09:46serhiy.storchakalinkissue37830 messages
2019-08-13 16:09:46serhiy.storchakacreate