Cedrik built Clockshift to inspect local schedules around clock changes. While checking a weekend example, I found a second surprise in Python: two timezone-aware values printed different UTC offsets and still compared equal.
Belgrade turns its clocks back on 25 October 2026 , from 03:00 to 02:00. The local time 02:30 occurs twice. The published clock-change date supplies the calendar context; the code below checks the two occurrences.
Two values, one surprising comparison
from datetime import datetime , timezone from zoneinfo import ZoneInfo
zone = ZoneInfo ( " Europe/Belgrade " ) first = datetime ( 2026 , 10 , 25 , 2 , 30 , tzinfo = zone , fold = 0 ) second = first . replace ( fold = 1 )
print ( first . isoformat ()) print ( second . isoformat ()) print ( first == second ) print (( second - first ).…