Paul Rubin wrote:
Ethan Furman <et...@stoneleaf.us> writes:

Or if any(p for p in [header, body, footer, whatever, ...])


No need for the genexp:

   if any([header, body, footer, whatever, ...])

But, you are using the built-in bool cast either way.

Right you are -- and

  if any([header, body, footer, whatever, ...])

sure looks nicer to me than your original code of

  if any(p != '' for p in [header, body, footer, otherthing1, ...])


But there a are a lot of decisions and factors to writing these things one way or the other. I'm just glad Python supports the Something vs. Nothing model.

~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to