pydantic-core
pydantic-core copied to clipboard
naive and aware constraints on datetime types
Should be fairly easy since speedate gives offset
as optional.
@antonagestam said he might be able to work on this, see https://github.com/pydantic/pydantic/discussions/3477#discussioncomment-3771452
A related note: I believe the "date-time"
format of JSON Schema is considered timezone-aware. That means that the aware
type should have it, but the naive
should not.
It also means it's slightly weird that datetime.datetime
has it but without enforcing it, IMO. It might be worth putting in some time into documenting these things, and perhaps recommending usage of aware
over datetime.datetime
?
Totally agree, plan is to rewrite the documentation completely - on my long list of things to do.
@samuelcolvin Cool, that's good to know! 👍
Just to be clear, speedate is part of the pydantic org, and I built it specifically for pydantic-core, so we can change it if required.
I'm taking an initial look at this. Just setting up and familiarizing myself with the project etc, so I don't want to raise any expectations still, but thought I'd let you know 🙂
That's great news, let me know if you have any questions. Good luck.