== checks value equality, is checks object identity (same memory address).
1a = [1, 2, 3]2b = [1, 2, 3]3c = a45print(a == b) # True (same values)6print(a is b) # False (different objects)7print(a is c) # True (same object)
When to use:
1# Correct2if x is None:3 ...45# Incorrect6if x == None: # Works, but not recommended7 ...