Conditional operator in Python?

Thomas Heller thomas.heller at ion-tof.com
Mon Apr 2 10:08:27 EDT 2001


> On Sun, 1 Apr 2001, Fredrik Lundh wrote:
> [...]
> > here's the eff-bot's favourite lambda refactoring rule:
> >
> > 1) write a lambda function
> > 2) write a comment explaining what the heck that lambda does
> > 3) study the comment for a while, and think of a name that captures
> >    the essence of the comment
> > 4) convert the lambda to a def statement, using that name
> > 5) remove the comment
> [...]
>
> Why 5)?
Avoid duplication.

Thomas





More information about the Python-list mailing list