r/Python • u/dankey26 • Dec 19 '22
Intermediate Showcase multi line lambdas, as god intended

codec abuse, part 2. https://github.com/dankeyy/superlambda.py
gl hf hope you like it
53
Upvotes
r/Python • u/dankey26 • Dec 19 '22

codec abuse, part 2. https://github.com/dankeyy/superlambda.py
gl hf hope you like it
View all comments
Show parent comment
1
u/whateverathrowaway00 Apr 15 '23
I said “anonymous classes/functions”, IE both.
Lambdas are anonymous functions. The example I linked is of anonymous classes as most pure python people won’t have encountered them.
Python is dynamic, so I see no need for them in the language. In statically typed languages, they do serve an excellent role, but in python with first order functions, no need - even though personally I’d like it if they existed (obviously there are lambdas in python, but limited to one line among other restrictions).