Equality versus identity, and why `is None` is the one place `is` is standard.
Aditya Challa1 min read
In Python, == checks whether two objects have equal values, while is checks whether they are the exact same object in memory. Use == for comparing values and is mainly for singletons such as None.
PEP 8 says comparisons to singletons like None should use is or is not, never the equality operators.
x is 256 may appear to work because CPython caches some objects, but this is an implementation detail. Python 3.8+ warns with a SyntaxWarning when you use is with a literal.
Related: /blog/how-to-check-if-a-file-exists-in-python
Related: /blog/what-does-if-name-main-do-in-python
Lab evidence
Facts in this draft were checked on 12 Oct 2026 against the primary sources listed in the body (official docs, release schedules or Google/YouTube help pages). No benchmarks or timings were run, so the post makes no performance or measurement claims; dates are quoted as published by the maintainers, and any estimate is labelled as such.
Explore the product
Freelancers and devs who want to turn coding skills into paid site builds
Generators, lazily: what yield actually does to a function.
Summary12 Oct 20261 min read
Assignment expressions, explained with the examples that actually help.
Summary12 Oct 20261 min read
The official support dates for Django's current long-term support release.
Summary12 Oct 20261 min read