[Python-ideas] YAML (yet-another-multiline-lambda)
Antony Lee
anntzer.lee at gmail.com
Thu Oct 24 07:02:25 CEST 2013
I'm sorry I raised the inline class idea, which is distracting the main
issue here -- inline functions (again, all I wanted to do was to point out
the syntactic similarity).
I certainly don't think that creating bound methods through __get__ is a
particularly recognized idiom (although one may note that descriptors were
(I believe) introduced exactly for that purpose); on the other hand as I
mentioned earlier I don't really see the need for binding lambdas to
objects in the first place.
Antony
On Wednesday, October 23, 2013 12:57:46 AM UTC-7, Andrew Barnert wrote:
>
> On Oct 22, 2013, at 12:13, Antony Lee <anntz... at gmail.com <javascript:>>
> wrote:
>
> > Also, if you really need to bind the first variable and don't want to
> use partial, you can also use __get__, which exactly creates bound methods:
> (lambda x: x).__get__(1)() ==> 1.
>
> Do you think this is something that most Python users would understand
> today, or do you think Python would be a better language if it were a
> recognized idiom?
>
> I'll answer the other part when I'm in front of a computer.
> _______________________________________________
> Python-ideas mailing list
> Python... at python.org <javascript:>
> https://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131023/4870a648/attachment.html>
More information about the Python-ideas
mailing list