[Python-ideas] Syntactic sugar to declare partial functions

Abe Dillon abedillon at gmail.com
Mon Aug 13 20:38:40 EDT 2018


[Steven D'Aprano]

> - I accept that there've been a few cases where I could have
>   chosen my words better, and consequently I've rubbed Abe
>   the wrong way; sorry about that Abe, as I said earlier (and
>   I meant it) I have no grudge against you.


Thank you. I hold no grudge against you either. I'm sorry for all the drama.

[Steven D'Aprano]

> - The most important technical issue I wanted to get from my
>   discussion with Abe has been solved, I now believe that I
>   understand what harm he feels was caused by chosing the name
>   "lambda" over some alternative.
> - Namely (if I have understood Abe correctly) its the lost
>   opportunity to have a better name.


Yes. That's pretty much it. In hindsight, I should have realized that the
word "harm" carries a much more sever context in the programming community
given all the "X considered harmful" articles out there.

[Steven D'Aprano]

>  - Which seems to me to be so slight a harm that I don't think
>   it gives us any guidance at all as to whether "partial" or
>   "given" would make a better name for this proposed feature.


I consider jargon for jargon's sake to be a poor reason to choose one term
over a much more common term, however; I don't consider all jargon equal. I
think "anonymous function" is far more descriptive than "lambda". I think
you're ultimately right, however; that this doesn't guide the decision of
"partial" over "given" very much because "partial" is not all that obscure.
"partial function application" is fairly clear and as you said, Python
wouldn't be trying to create an association from scratch.

[Steven D'Aprano]

> It certainly has not been helped by people fanning the flames of
> argument by calling this a "toxic forum".


At that point I felt like I had expressed that you came off as antagonistic
toward me, had my feelings brushed off, then had multiple people ganging up
on me about something I thought I had clearly articulated.

I don't want to start a big fuss about it, but now both you and Stephen
Turnbull have not-so-subtly referred to me indirectly like this. This time
is fairly benign, but Turnbull's remark comes off as a passive-aggressive
way of calling me toxic. I hope this isn't a sign of things to come where
it's fine to passive-aggressively sling mud, but being direct is considered
"crossing the line", because I find passive aggression far more insulting.
I'm not an eight-year-old and people hiding behind the plausible
deniability that even thinly veiled passive aggression affords them
frustrates me. As I said early on: I'd rather resolve issues than have them
continue to fester. Passive aggression does the exact opposite.

[Steven D'Aprano]

> We should assume good faith. Before flying off the handle and taking
> offense, we should assume misunderstanding (on either or both party),
> accidental poor choice of wording, or merely robust debate rather than
> malice. We ought to be careful about making assumptions about people's
> motives from their responses. Email is a notoriously bad medium for
> judging people's motivation.
> The rest that follows is detail, responding to a few specific points
> which I deem relevant but not essential.


Those are wise words and I'll try to adhere to them in the future. I would
like to amend, that when someone signals that they feel like you're being
aggressive towards them, it's a good idea to apologize. It's a simple act
that can diffuse a lot of tension.

[Steven D'Aprano]

> > I explained my position on lambda as fully as I care to in my response to
> > Niel if you care to read it.
> I did read it. Just because I didn't respond to it directly doesn't mean
> I didn't read it.


I didn't mean that as an accusation that you hadn't read it. I'm sorry it
came off that way.

[Steven D'Aprano]

> You say you object to the name, but then suggest a change that is
> idependent of that name.


Yes, I can see how that could lead to confusion. I'm sorry.

I do, indeed, have two mostly separate objections to 'lambda':
1) I think it's a bad name
2) I think it's a sub-optimal form

The only relevance of the form is that it sort-of illustrates a broader
name-space to explore. For instance, the alternative name 'def' doesn't
really make sense in the reversed order:

hand = sorted(cards, key=def card: card.suit)  # this kinda works, at least
I think it's better than 'lambda'

hand = sorted(cards, key=(card.suit def card)  # this is... not as good

[Steven D'Aprano]

> > [Steven D'Aprano]
> >
> > > How can we insist that 3/4 of the world learn English words to use
> Python
> >
> > Do you really think that 3/4 of the world learns English just to write
> > Python?
> That's not what I wrote. There's a difference between these two
> positions:
> - needing to learn to read English words to use Python;
> - using Python is the only reason to learn English.
> I said the first, not the second.


I don't mean to come off as combative, but that is a direct quote, and I
didn't try to take it out of context. If I did take it out of context, then
I'm sorry.
My point was that (and I may be wrong about this)  I don't imagine most
non-english speakers who want to write Python learning just enough English
to write python.
I imagine that most of them learn a broader vocabulary and thus,
discussions about common English words still apply to them.

It would be interesting to know either way, so maybe we should have a poll?
I don't know.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180813/01d9ad88/attachment-0001.html>


More information about the Python-ideas mailing list