Ok, this is tricky.
So pretty much impossible, given that `Break`, if it was to work has to be 
evaluated in reference scope, while other delayed objects in their definition 
scope.

----------------------
Back to deferred evaluation.

----------------------
Giving it a rest for a while. Thank you for your patience.


> On 20 Jul 2023, at 12:38, Chris Angelico <ros...@gmail.com> wrote:
> 
> 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/RTKFGBNVJ2UQSMFTFNAHFB7HS674GI4B/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to