Code formatting question: conditional expression

Nicola Larosa (tekNico) nicola.larosa at gmail.com
Tue Aug 25 18:06:37 CEST 2009


John Posner wrote:
> Is there any consensus on how to format a conditional expression
> that is too long for one line?

Here's my take:

    excessblk = Block(total - P.BASE, srccol,
carry_button_suppress=True
        ) if total > P.BASE else None

--
Nicola Larosa - http://www.tekNico.net/

Nobody knows everything, and nobody is expected to be perfect
in the Ubuntu community (except of course the SABDFL).
 - https://launchpad.net/codeofconduct/1.0



More information about the Python-list mailing list