September 14, 2026
== vs. is in Python: What's Actually Different
== and is can look interchangeable in casual code, because they frequently agree — until the one case where they don't, which is usually where the bug shows up.
== compares values, is compares identity
== asks "do these hold the same value?" is asks "are these literally the same object in memory?" a and b above are two separate lists that happen to contain identical elements — equal, but not the same object, which is exactly what a == True / a is False shows.
Assignment in Python doesn't copy a list — c = a makes c point to the exact same object as a, not a new list with the same contents. That's why c is a is True here, unlike the a is b comparison above.
The one place is is actually correct
The one place you should genuinely reach for is instead of == is comparing against None — writing if x is None, not if x == None. None is a singleton (there's only ever one None object in a running program), so identity is both faster to check and the style Python's own style guide (PEP 8) recommends.
For more on comparisons and conditions, see the Conditional Statements lesson in our free Python course.