News for hackers. Stuff that matters.
Re:Functools – The Power of Higher-Order Functions in Python by mypalmike on Friday July 09, 2021 @04:13AM (#27781505)
A pure function (which a lambda typically is) answers a question. It's helpful to have words describing what question it answers. The next person to read the code will actually be able to read the words.

An if statement is a lower level mechanism for directing the code path within a function. If it needs a name, wrap it in a function. I often do.

Re:Functools – The Power of Higher-Order Functions in Python by HelloNurse on Friday July 09, 2021 @05:20AM (#27781864)
Control statements rarely "need" a name, but if they are significant enough to be named they can be named by extracting meaningful and somewhat reusable functions.