jcrist · GitHub

added 8 commits

December 4, 2022 13:34
Adds a new `tz` constraint for specifying whether the value:
- must be timezone aware (`tz=True`)
- must be timezone naive (`tz=False`)
- may be either timezone aware or timezone naive (`tz=None`, the
  default).
These encode as almost-RFC3339-compatible strings; the only difference
is no offset component.
- By default `datetime.datetime` types will decode both naive and aware
  datetimes. The presence/absence of a timezone can be enforced by
  specifying `tz=True`/`tz=False` to a `msgspec.Meta` annotation.
- The msgpack decoder now decodes datetimes from strings as well as the
  timestamp extension. The encoder will always use the timestamp
  extension when possible, only falling back to encoding to strings
  when encoding a naive datetime.

@jcrist

@jcrist

Closed

Read the original on github.com ↗