@@ -1329,9 +1329,11 @@ Supported operations:
13291329
13301330 Naive and aware :class: `.datetime ` objects are never equal.
13311331
1332- If both comparands are aware, and have the same :attr: `!tzinfo ` attribute,
1333- the :attr: `!tzinfo ` and :attr: `~.datetime.fold ` attributes are ignored and
1334- the base datetimes are compared.
1332+ If both comparands are aware, and have the same :attr: `!tzinfo ` and
1333+ :attr: `~.datetime.fold ` attributes, the base datetimes are compared.
1334+ If both comparands are aware, and have the same :attr: `!tzinfo ` but
1335+ differing :attr: `~.datetime.fold ` attributes, the objects are converted to
1336+ timestamps, and the timestamps are compared.
13351337 If both comparands are aware and have different :attr: `~.datetime.tzinfo `
13361338 attributes, the comparison acts as comparands were first converted to UTC
13371339 datetimes except that the implementation never overflows.
@@ -1345,9 +1347,11 @@ Supported operations:
13451347 Order comparison between naive and aware :class: `.datetime ` objects
13461348 raises :exc: `TypeError `.
13471349
1348- If both comparands are aware, and have the same :attr: `!tzinfo ` attribute,
1349- the :attr: `!tzinfo ` and :attr: `~.datetime.fold ` attributes are ignored and
1350- the base datetimes are compared.
1350+ If both comparands are aware, and have the same :attr: `!tzinfo ` and
1351+ :attr: `~.datetime.fold ` attributes, the base datetimes are compared.
1352+ If both comparands are aware, and have the same :attr: `!tzinfo ` but
1353+ differing :attr: `~.datetime.fold ` attributes, the objects are converted to
1354+ timestamps, and the timestamps are compared.
13511355 If both comparands are aware and have different :attr: `~.datetime.tzinfo `
13521356 attributes, the comparison acts as comparands were first converted to UTC
13531357 datetimes except that the implementation never overflows.
@@ -1364,6 +1368,11 @@ Supported operations:
13641368 The default behavior can be changed by overriding the special comparison
13651369 methods in subclasses.
13661370
1371+ .. versionchanged :: 3.15
1372+ Comparison between :class: `.datetime ` objects with matching :attr: `!tzinfo `
1373+ and differing :attr: `~.datetime.fold ` attributes uses timestamps for
1374+ comparison, so that ordering is preserved even in the case of a repeated
1375+ interval.
13671376
13681377Instance methods:
13691378
0 commit comments