[Python-ideas] Syntactic sugar to declare partial functions

Abe Dillon abedillon at gmail.com
Mon Aug 13 01:25:57 EDT 2018


[Chris Angelico]

> lst.onselect = anonfunc(print(target_item))
> What's target_item? If you can't see the signature and see that it's a
> parameter, you should look externally for it.


If you're not even going to read the explanation I've already given, then I
have no reason to respond. Your example looks nothing like what I've
suggested and this whole conversation is being derailed by your need to win
the argument.

On Mon, Aug 13, 2018 at 12:04 AM, Chris Angelico <rosuav at gmail.com> wrote:

> On Mon, Aug 13, 2018 at 2:56 PM, Abe Dillon <abedillon at gmail.com> wrote:
> > [Chris Angelico]
> >>
> >> Also, the signature is most decidedly NOT obvious from context
> >
> > Who decided this? It's been decided by some committee? When you write a
> key
> > function, you don't know how many arguments are going to be passed?
>
> lst.onselect = anonfunc(print(target_item))
>
> What's target_item? If you can't see the signature and see that it's a
> parameter, you should look externally for it. What are the parameters
> to an onselect function? Doesn't that seem important enough to see the
> signature up front?
>
> It's not just *how many* arguments are being passed. It's what they're
> called, too. You cannot interpret the body of a function without
> knowing that. Hiding that off to the end would make the language
> worse, not better.
>
> Plus, can you name any similar language that does that? Every other
> language I can think of has the parameters before the body. While this
> isn't a clinching argument by any means (Python has a different
> argument order for the ternary if operator, for instance), it's
> indicative.
>
> ChrisA
> _______________________________________________
> 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/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180813/e33aa9bf/attachment.html>


More information about the Python-ideas mailing list