Einstein summation notation (was: question of style)

Paul Rubin http
Fri Jul 17 03:34:00 EDT 2009


Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:
> It is very useful to be able to write e.g.:
> if header or body or footer:
>     print assemble_page(header, body, footer)
> and have empty strings to be equivalent to False.

Why doesn't assemble_page properly handle the case where header, body,
and footer are all empty?  That would let you eliminate the if.  "Make
sure your code 'does nothing' gracefully" (Kernighan and Plauger).



More information about the Python-list mailing list