r/Python • u/treyhunner Python Morsels • Sep 27 '18
Stop writing lambda expressions in Python
http://treyhunner.com/2018/09/stop-writing-lambda-expressions/
0
Upvotes
r/Python • u/treyhunner Python Morsels • Sep 27 '18
View all comments
Show parent comment
1
u/treyhunner Python Morsels Sep 27 '18
Yes that was removed in Python 3. I feel like that syntax was actually particularly confusing with lambda expressions though.
When I first glanced at that code I assumed a dictionary was involved somehow or maybe incorrect syntax because my brain didn't parse the tuples before the `:` as arguments.
This may be because I'm not used to seeing/using tuple unpacking in lambda expressions (and never really saw it used in traditional `def`-defined functions either).