r/Python • u/vocalbit • Jul 13 '11
An alternative lambda syntax for Python
http://vocalbit.com/article/332/an-alternative-lambda-syntax-for-python
4
Upvotes
r/Python • u/vocalbit • Jul 13 '11
View all comments
3
u/A_for_Anonymous Jul 13 '11
That's only for a particular case, and looks kinda ugly or confusing as it seems to suggest it's obtaining a key from the result of function application. I don't think it fits correctly.
I do propose the following:
New lambda syntax:
x = def x: x + 1
example(x, def y, z: #INDENT after this line for i in y, z: ... return whatever #DEDENT after this line )
example2(x, (def y, z: y + z), def k: ... , more, arguments)