Pattern: Missing use of is not
for object identity test
Issue: -
Tests for object identity should use the form x is not None
rather than not x is None
. The former example is more readable.
if not user is None:
print(user.name)
if user is not None:
print(user.name)