On Mon, 5 Dec 2022 at 04:07, Rob Cliffe via Python-ideas
<python-ideas@python.org> wrote:
>
>
>
> On 30/11/2022 20:27, Anony Mous wrote:
> > Danceswithmice wrote:
> >
> >
> >
> > The idea is that YOU write "local:", and the interpreter, without you
> > ever seeing it, promotes that into a hidden function with a hidden
> > name and a hidden call.
> >
> > ---
> >
> > p.f.moore wrote:
> >
> > > That would make "return" in the local scope exit the scope, not the
> > enclosing function. Which is almost certainly not what people would expect
> > from a "local scope" statement.
> >
> > Hence my remark about return and yield requiring attention. These
> > would be disallowed in the context of "local:" UNLESS there is an
> > enclosing scope of "def function():", so there's no issue of what they
> > do if they are simply mainlined, and (I think) a well defined result
> > if they are not.
> >
> What about getting an untrapped exception? Again, your suggestion would
> mean that only the local scope is exited.  Again, this would be unexpected.

Why? Wouldn't an uncaught exception bubble up until it is caught?

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/BJHRJ3WBGJMXCUNNR3L57BTWOR57U45O/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to