3 ms·
The fate of reduce() in Python 3000
- danuker 4y ago(2005)
- danuker 4y agoI 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.