On Mon, Oct 25, 2021 at 3:43 AM Jonathan Fine <jfine2...@gmail.com> wrote:
>
> Hi
>
> Please forgive me if it's not already been considered. Is the following valid 
> syntax, and if so what's the semantics? Here it is:
>
>     def puzzle(*, a=>b+1, b=>a+1):
>         return a, b
>
> Aside: In a functional programming language
>     a = b + 1
>     b = a + 1
> would be a syntax (or at least compile time) error.
>

There are two possibilities: either it's a SyntaxError, or it's a
run-time UnboundLocalError if you omit both of them (in which case it
would be perfectly legal and sensible if you specify one of them).

I'm currently inclined towards SyntaxError, since permitting it would
open up some hard-to-track-down bugs, but am open to suggestions about
how it would be of value to permit this.

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

Reply via email to