[Python-ideas] A simple proposal concerning lambda

Abe Dillon abedillon at gmail.com
Tue Aug 21 23:21:34 EDT 2018


[Chris Angelico]

> Though... it's insignificant when the function header precedes the
> expression/body. With the proposal to move the header to the end, that
> might become problematic, which makes it yet another cost to the
> proposal.


I don't think it would be a problem because, like ternary and other
circuiting operations, the expression isn't evaluated until certain
criteria are met.
The arrangement shouldn't matter.

...I think.

On Tue, Aug 21, 2018 at 10:10 PM Chris Angelico <rosuav at gmail.com> wrote:

> On Wed, Aug 22, 2018 at 12:57 PM, Abe Dillon <abedillon at gmail.com> wrote:
> > [Chris Angelico]
> >>
> >> If you have a use-case for a lambda function that takes a callback and
> >> has a default value for that callback, please submit it to The Daily
> >> WTF. In Steve's example, the main function was created with a
> >> statement.
> >
> >
> > Fair enough, but I still think D'Aprano may have engineered his example
> to
> > be particularly unreadable.
> > Why would you use 'arg' for both the argument to the method and the
> > callback! That's at least a little WTF.
>
> True, but hardly significant. The one inside lambda is local to it.
>
> Though... it's insignificant when the function header precedes the
> expression/body. With the proposal to move the header to the end, that
> might become problematic, which makes it yet another cost to the
> proposal.
>
> 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/20180821/7bf5be98/attachment.html>


More information about the Python-ideas mailing list