News for hackers. Stuff that matters.
Re:The unknown features of Python's `operator` module by hansvm on Monday August 09, 2021 @10:26AM (#28117261)
A typical use case for lambdas is passing them as arguments to other functions, which implicitly assigns the lambda to some local variable. Using "def" instead would be unlikely to be cleaner.

Maybe you still want to know how long it takes to create a lambda or import from operator, but if such a function is being called more than a few times (and if not, why are we concerned about performance?), execution time will dominate other factors.

There are no comments on this comment yet.