[Python-ideas] Syntactic sugar to declare partial functions

Chris Angelico rosuav at gmail.com
Sun Aug 12 23:50:38 EDT 2018


On Mon, Aug 13, 2018 at 1:31 PM, Abe Dillon <abedillon at gmail.com> wrote:
> [Steven D'Aprano]
>>
>> Just because I challenge your statements doesn't mean I'm attacking you.
>
>
> No. Telling me I'm having an extreme overreaction means you're attacking me.

If your reaction was extreme, saying so isn't attacking you.

> [Steven D'Aprano]
>>
>> You've said that the choice of keyword, "lambda", has caused harm. Given
>> the chance to clarify what you meant, you stood by your comment that the
>> choice of keyword "lambda" has done real, significant, non-trivial harm
>> to Python (the language, or the community).
>
>
> What are you talking about? I explained exactly what I meant:
>
>> I think there are better ways that anonymous functions could have been
>> implemented.  I've already said in past discussions, I think the expression
>> should come before the signature because the signature is often obvious from
>> context so placing it before the logic is kinda noisy. I don't know what the
>> best syntax would have been, but I refuse to believe that an esoteric word
>> from an esoteric branch of calculus with an arbitrary etymology was the
>> absolute best choice available. I think the harm that choice caused is
>> relatively minor, but I don't think it was a great choice.
>
>
> Notice: I never said "real, significant, non-trivial harm" anywhere in this
> entire discussion. I never said anything close to that. Stop jamming
> bullshit in my mouth to suit your narrative that I'm "extremely
> overreacting". It's not cute.

Explain, please, what the HARM is that comes from the use of the word
"lambda". In contrast, using the word "function" does definitely have
harm, because you can no longer use the name "function" as a variable
or parameter.

Also, the signature is most decidedly NOT obvious from context, nor is
it insignificant. Putting it first gives context to the body of the
function. Python made the correct choice here.

> [Steven D'Aprano]
>>
>> But we ought to "check our privilege", as they say. I think that if we
>> as a community automatically reject any word because it isn't "plain
>> English", that would be a sign of unexamined privilege and quite rude to
>> boot.
>
>
> Rude? Who would it be rude to if we had chosen "anonfunc" instead of
> "lambda"?

No, but it's no less jargonny.

> Very few of us are computer scientists by profession. That's not even where
> 'lambda' comes from. In computer science, it's called an "anonymous
> function". "lambda" comes from lambda calculus.

https://en.wikipedia.org/wiki/Anonymous_function

"In computer programming, an anonymous function (function literal,
lambda abstraction, or lambda expression) is a function definition
that is not bound to an identifier."

So... I would say "lambda" is very firmly connected with anonymous functions.

ChrisA


More information about the Python-ideas mailing list