jcrist · GitHub

Merged

Merged

Conversation

This adds a new `str_values` boolean keyword argument to
`from_builtins`, defaulting to `False`. If set to `True`, `int`,
`float`, `bool`, and `None` types will also support decoding from `str`
values. This is useful for protocols that only have string scalars (like
URL query parameters).
Ordered by type likelihood in common message structures.
A micro-optimization, saves ~600 ns per call on my machine. If this
wasn't easy to do it wouldn't be worth it.
Adds prose docs for `from_builtins` and `to_builtins`.

@jcrist

@jcrist

jcrist deleted the from-builtins-str-values branch

February 7, 2023 04:12

Labels

None yet

Read the original on github.com ↗