jcrist · GitHub

Merged

Merged

Conversation

This adds support for decoding JSON from `str` objects, rather than just
`bytes` (or bytes-like) objects.
For peak performance it's still recommended to decode from a bytes-like
object, but native support for decoding from str types is faster than
forcing the user to call `str_message.encode("utf-8")` themselves.
This also adds support for formatting str JSON messages using
`msgspec.json.format`. If a str is passed in the return type is a str,
otherwise the return type is `bytes`.

@jcrist

@jcrist

jcrist deleted the support-decode-json-from-str branch

December 7, 2022 02:46

Merged

Labels

None yet

Read the original on github.com ↗