Continuing indentation

Ben Finney ben+python at benfinney.id.au
Wed Mar 2 21:30:23 EST 2016


Steven D'Aprano <steve at pearwood.info> writes:

> If you only use "continue_playing" in exactly one place, then it
> doesn't deserve a name.

I disagree. If it's complex, then it may still deserve a name.

> > Names are important!
>
> Too important to waste on every single-use expression.

To waste on *every* single-use expression? Of course. No one was
advocating that.

The point is to bind a descriptive name to a *complex* expression, if
doing so will clarify the semantic intent of that expression.

If your functions are so long that you fear using a specific name will
deter you from using it again *in the same scope*, then the name isn't
descriptive and a better one should be chosen, or the function is too
large and should be broken into smaller pieces.

-- 
 \      “The history of Western science confirms the aphorism that the |
  `\     great menace to progress is not ignorance but the illusion of |
_o__)            knowledge.” —Daniel J. Boorstin, historian, 1914–2004 |
Ben Finney




More information about the Python-list mailing list