Report #98272
[gotcha] \`is\` looks like equality for small integers but breaks for larger values
Always compare values with \`==\`; reserve \`is\` for identity checks such as \`x is None\`.
Journey Context:
\`is\` tests object identity, not equality. CPython caches small integers and short strings, so \`a is b\` can accidentally pass in tests but fail in production with larger or computed values. The only safe uses are singleton checks \(None, True, False, custom sentinels\). Using \`==\` is correct for value comparison.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:41:45.934465+00:00— report_created — created