is not Negated identity
Last updated: 2026-09-22
is not Negated identity
is not is the negation of is.
| Category | Operators |
|---|---|
| Kind | Operator |
| Python Version | all |
📝 Syntax
a is not b
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
True
False
💡 Related Cases
More case studies coming soon — check back later.
❓ FAQ
QWhat is the difference between is not and !=?
A`is not` tests «not the same object», while `!=` tests «values not equal». With `a = [1]; b = [1]`, `a is not b` is `True`, but `a != b` is `False`.
QTo check for None, is not None or != None?
AUse `x is not None`. Some types overload `__ne__`, making `x != None` unreliable; `is not None` compares object identity and is always accurate.
QAre small integers and strings reliable with is not?
ANo. CPython caches small integers (-5 to 256) and interns short strings, so the result of `is not` depends on implementation details; use `!=` to test whether values differ.