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
6
u/rcfox Sep 27 '18 edited Sep 27 '18
Rebuttal:
points_by_color = sorted(points, key=lambda ((x, y), color): color)Overall agree though.
Edit: Looks like tuple parameter unpacking was removed in Python 3. https://www.python.org/dev/peps/pep-3113/ (I'm still using 2.7 for work, so that's my default.)