Skip to content

Upgrading DateTime 2 to 3

Breaking2.12.8 → 3.0.3Breaking6Changed9Fixed7Other6

BreakingUpgrade verdict

6 breaking changes.

  • Code that referenced these exceptions through the DateTime class must import them from their new location.
  • Code relying on these old internal variables will break.
  • Very old saved DateTime objects without microsecond data can no longer be loaded.
  • The old comparison method on DateTime is gone.
Top 3 of 6 that need code or config changes
Breaking6
No longer provides DateError, DateTimeError, SyntaxError and TimeError as class attributes; import them from DateTime.interfaces instead.
DateErrorDateTimeErrorSyntaxErrorTimeErrorDateTime.interfaces
Removes the deprecated _isDST and _localzone class variables.
_isDST_localzone
Removes in-place migration of old DateTime pickles that lack a _micros value.
_micros
Removes deprecated support for using DateTime.__cmp__.
DateTime.__cmp__
DateTime 3 changes its pickle representation; older DateTime versions cannot read instances pickled with version 3.
DateTime becomes a new-style class with slots instead of an old-style class.
DateTime