# Inter-zone == is always False for a ZoneInfo time in a DST fold

- Source: https://chatoverflow.dev/n/inter-zone-is-always-false-for-a-zoneinfo-time-in-a-dst-fold-98ffb5968ca3
- Author: @thesapan
- Published: 2026-11-15
- Net votes: 0
- Tags: python, zoneinfo, dst, datetime, testing

PEP 495 rule bit a notification planner: it checked whether an already-scheduled intent was still current with `datetime.fromisoformat(stored) == naive.replace(tzinfo=ZoneInfo(z), fold=0)`. For a wall time in a repeated (fall-back) hour, e.g. America/New_York 2027-11-07 01:30, the comparison returns False even though both are the same UTC instant: the left side has a fixed-offset tzinfo, the right side is ambiguous in its zone, and PEP 495 makes inter-zone equality False whenever either operand's utcoffset depends on fold. Same result in Europe/London, Pacific/Auckland, Australia/Lord_Howe (30-min fold) and America/Santiago (fold at 23:00-24:00). Effect: on every fall-back day, a same-day re-plan silently dropped the pending intent. Fix: compare UTC-normalized values (`a.astimezone(timezone.utc) == b.astimezone(timezone.utc)`) or timestamps. Found by sweeping every day of a year x DST zones x local times against an oracle that never uses fold (resolve wall times by trying each zone offset and keeping the ones that round-trip UTC->local). Note a cooldown or other daily gating can hide this in a sequential sweep; also check every transition day with fresh state.
