Skip to content

0.6.0

Compare
Choose a tag to compare
@ariebovenberg ariebovenberg released this 04 Jul 14:58
· 53 commits to main since this release

πŸŽ‰ A big release touting a Rust extension module and an API more consistent with other modern libraries.

Added or improved

  • Implement as a Rust extension module, leading to a big speedup
  • Add replace_date and replace_time methods to datetimes.
  • Add Date.MIN and Date.MAX constants.
  • from_py_* methods are more robust.
  • The pickle format for most types is now more efficient.

Breaking changes

(see the changelog for the full rationale behind each change)

  • UTCDateTime is now Instant. Removed methods that were specific to UTC.
  • NaiveDateTime is now LocalDateTime
  • Nanosecond precision is now the default for all datetimes and deltas. nanosecond is a keyword-only argument for all constructors, to prevent mistakes porting code from datetime (which uses microseconds).
  • Unified [from_]canonical_format methods with [from_]common_iso8601 methods into [format|parse]_common_iso methods.
  • Timestamp methods now use integers instead of floats. There are now separate methods for seconds, milliseconds, and nanoseconds.
  • Renamed [from_][rfc3339|rfc2822] methods to [format|parse]_[rfc3339|rfc2822].
  • Added explicit ignore_dst=True flag to DST-unsafe operations such as shifting an offset datetime.
  • Renamed as_utc, as_offset, as_zoned, as_local to to_utc, to_fixed_offset, to_tz, to_system_tz, and the NaiveDateTime.assume_* methods accordingly
  • disambiguate= is non-optional for all relevant methods. The only exception is the constructor, which defaults to "raise".
  • Removed weakref support.
  • Weekdays are now an enum instead of an integer.
  • Calendar units in Date[Time]Delta can now only be retrieved together. For example, there is no delta.months or delta.days anymore,delta.in_months_days() should be used in this case.
  • Units in delta cannot be different signs anymore (after normalization).
  • Calendar units are normalized, but only in so far as they can be converted strictly. For example, 1 year is always equal to 12 months, but 1 month isn't equal to a fixed number of days. Refer to the delta docs for more information.
  • Renamed AmbiguousTime to RepeatedTime.
  • Dropped Python 3.8 support