not None test in Python

Viewed 1071607

Out of these not None tests.

if val != None:

if not (val is None):

if val is not None:

Which one is preferable, and why?

4 Answers
Related