Check if one of variables is set to None

Viewed 21425

I recently had to implement a small check for any variables that might have not been initialized (and their default value is None). I came up with this:

if None in (var1, var2, var3):
    error_out()

While, in my eyes, bordering on beautiful, I was wondering - is this a good way to do it? Is this the way to do it? Are there any cases in which this would produce some unexpected results?

3 Answers
Related