On Thu, 20 Jul 2023 at 19:34, Dom Grigonis <dom.grigo...@gmail.com> wrote:
> And ideally, adding 2 builtin(or imported from stdlib) functions: `Break` and 
> `Continue`, which if called act as `break` and `continue` statements.
>

How would they work? Would every function call have to provide the
possibility to return to a location that wasn't where you would
otherwise go?

if random.randrange(2):
    func = Break
else:
    def func(): pass

def wut():
    for i in range(1, 10):
        if i % 3: func()
        print(i)

wut()

Please, tell me how this would behave.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/77JRIT2DXV3NGPLAJPHZAPFBTTVEZSB2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to