Functions Of Functions Returning Functions

dieter dieter at handshake.de
Mon Sep 19 02:53:59 EDT 2016


Lawrence D’Oliveiro <lawrencedo99 at gmail.com> writes:
> The less code you have to write, the better. Less code means less
> maintenance, and fewer opportunities for bugs.

While I agree with you in general, sometimes less code can be harder
to maintain (when it is more difficult to understand).

Some time ago, we had a (quite heated) discussion here about
a one line signature transform involving a triply nested lambda construction.
It was not difficult for me to understand what the construction did;
however, the original poster found it very difficult to grasp.

Often, functions returning functions are more difficult to understand
than "first order" functions (those returning simple values only) --
at least for people not familiar with higher abstraction levels.




More information about the Python-list mailing list