This is a problem that occured to me while working on a Django project. It\'s about form validation.
In Django, when you have a submitted form, you can call is
How about something like:
if all([form1.is_valid(), form2.is_valid()]):
...
In a general case, a list-comprehension could be used so the results are calculated up front (as opposed to a generator expression which is commonly used in this context). e.g.:
if all([ form.is_valid() for form in (form1,form2) ])
This will scale up nicely to an arbitrary number of conditions as well ... The only catch is that they all need to be connected by "and" as opposed to if foo and bar or baz: ....
(for a non-short circuiting or, you could use any instead of all).