title: end of daylight savings time
body: <p>I'm trying to verify if my understanding about pythons time (and daylight savings time) handling is correct. I've written the following code:</p>
  <pre class="lang-py prettyprint-override"><code>import datetime
  import zoneinfo
  
  def test_switchover() -&gt; None:
      zone = zoneinfo.ZoneInfo('Europe/Berlin')
      
      expected = datetime.datetime(year=2022, month=10, day=30, hour=2, minute=30, fold=1, tzinfo=zone)
  
      base = datetime.datetime(year=2022, month=10, day=30, hour=2, minute=30, fold=0, tzinfo=zone)
      got = base + datetime.timedelta(hours=1)
  
      assert expected == got
  </code></pre>
  <p>(note that <code>expected</code> has fold=1, which marks it as the second occurrence of 2:30)</p>
  <p>Daylight savings time in Germany ends on 2022-10-30. Clocks are moved back from 03:00:00 CEST to 02:00:00 CET.</p>
  <p>All datetime objects in my code are timezone aware. Therefore, 1 hour after 02:30:00 should again be 02:30:00. But the assertion fails!</p>
  <pre><code>&gt;       assert expected == got
  E       AssertionError: assert datetime.datetime(2022, 10, 30, 2, 30, fold=1, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin')) == datetime.datetime(2022, 10, 30, 3, 30, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))
  
  tests/test_python_dst_switchover.py:12: AssertionError
  </code></pre>
  <p>Why?</p>
  <p>(python 3.10)</p>