PEP new assert idiom

Fábio Mendes niels_bohr at uol.com.br
Sun Nov 7 03:18:25 EST 2004


> So follow PEP 8's recommendation instead:
> 
> assert (
>    exp1 and
>    exp2 and
>    ...
>    expn
>    ), 'Errormsg'
> 
I didn't know this would work for 'and/or' operators (even I've read the
style guide PEP!), sorry. It's not super beautiful, but I could live
happy with that :)

> I don't see the parentheses (which clarify the syntax issue you
> mentioned in your first post) and 'and' as any uglier than the commas.
> And having commas mean line continuation is out of the question.

I never said that commas should mean line continuation (as a backslash).
It CAN be used as implicit line continuations in lot cases, (like
function arguments, for instance. This would be just one more case.

Cheers,
Fabio



More information about the Python-list mailing list