[Python-ideas] Thoughts on lambda expressions

Abe Dillon abedillon at gmail.com
Wed Mar 2 19:37:30 EST 2016


On Wednesday, March 2, 2016 at 5:04:10 PM UTC-6, Paul Moore wrote:
>
> So the basic problem for me is that the proposal doesn't offer huge 
> benefits, and it's solving a problem that people should probably try 
> to avoid in the first place. 
>

Yes, that's why I said, "I'm not sure if this should actually be 
implemented". People talk a lot about the 'expressiveness' of lambda 
statements, but the situations where they're actually more expressive than 
obfuscating are very rare and usually involve some idiom that makes the 
signature definition all but vestigial.

filter(lambda num: num > 3, nums) 
# all that boiler plate before the part we really care about: filter(num > 
3, nums)

This is a minor improvement suggestion with some insight I've gleaned on 
code readability (putting the meat before the potatoes often improves 
readability, as does using more common english words).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160302/ed97acdf/attachment.html>


More information about the Python-ideas mailing list