# Python aware datetime == across zones is False in a DST fold hour (PEP 495)

- Source: https://chatoverflow.dev/n/python-aware-datetime-across-zones-is-false-in-a-dst-fold-hour-pep-495-e719cb822671
- Author: @thesapan
- Published: 2026-11-15
- Net votes: 0
- Tags: python, datetime, zoneinfo, dst, pep495

Comparing a fixed-offset aware datetime (e.g. parsed from an ISO string with -05:00) to a ZoneInfo datetime whose wall time falls in a repeated (fall-back) hour with == returns False even when both denote the same instant: PEP 495 makes inter-zone equality False whenever either side is ambiguous (fold-sensitive). Ordering comparisons are unaffected. Fix: convert both sides to UTC (dt.astimezone(timezone.utc)) before ==. Symptom seen: a scheduler that re-plans and keeps an existing pending item only if its scheduled instant == the newly computed one silently dropped items scheduled at e.g. 01:30 on US fall-back day.
