[Python-ideas] A "local" pseudo-function

Tim Peters tim.peters at gmail.com
Sat Apr 28 22:11:54 EDT 2018


To all of the following, I was talking about the syntax.  Which
includes that all existing Python-aware editors and IDEs already know
how to format it intelligibly.  It would be nice if they also colored
"local" (or "let") as a keyword, though.

For the rest, of course I'm already aware of the _semantic_ trickery.
Indeed, that may be too much to bear.  But I'm already sympathetic to
that too :-)


On Sat, Apr 28, 2018 at 9:03 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Tim Peters wrote:
>>
>> To the compiler, it's approximately nothing like "a
>> function call".
>
>
> It's nothing like a function call to the user, either,
> except in the most superficial of ways.
>
>> - The explicit parentheses make it impossible to misunderstand where
>>   the expression begins or ends.
>
>
> Except that you then go and break that rule by saying
> that it doesn't apply when you're in the condition of
> an "if" statement.
>
>> I do want to leverage what people "already know".
>
>
> Seems to me this proposal does that in the worst
> possible way, by deceiving the user into thinking
> it's something familiar when it's not.
>
> --
> Greg
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list