4 ms·
I am glad lambdas did not get removed. I think another common use of lambdas is partial function application, since Python is missing currying and such. I enco
by danuker 4y ago
I am glad lambdas did not get removed. I think another common use of lambdas is partial function application, since Python is missing currying and such.
I encountered the need for this in numeric optimization. I want to have a function with more arguments for readability reasons, but want to fix all of them except my optimization domain.
- Doxin 4y agoThe pythonic way of doing partial function application is using functools.partial which has a couple of benefits when introspection happens. That said I personally find lambda much more readable than functools.partial.