Which way to test for a variable == None
is the more pythonic?
if var:
or
if var is not None
?
I personally would favor the primer. But the latter is more explicit. https://www.python.org/dev/peps/pep-0020/
But for what benefit? Beginner programmers - should this be assumed in production grade software?