-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support serialization of datetime.timedelta #260
Comments
Thanks for opening this issue. This is in-scope for msgspec, but isn't something we're going to accomplish in the near future as it's blocked by some deeper changes required. Other supported
Currently msgspec's extension mechanism only works for adding support for new types, there's no way to override how a builtin type is encoded/decoded. This is due to the single-callable nature of
Anyway, for now I recommend using the existing |
In my code I use datetime.timedelta to represent a Linux kernel
timeval
struct. However, timedeltas are not serializable currently.Of course, I could implement my own timedelta Struct, or use the existing hooks to add support for serializing this type. But it would be nice if msgspec supported this.
The text was updated successfully, but these errors were encountered: