Conversation
Closed
JSON as a protocol only supports string keys in objects, which means that arbitrary key types can't be used. Previously we only allowed `str` and `Literal[strings...]` types for dict keys. This commit relaxes this restriction to support the following key types: - `str` - `Literal[strings...]` - `Enum` - `int` - `Literal[integers...]` - `IntEnum` along with constraints on these types. Integer keys are encoded/decoded as integer strings (e.g. `1 -> "1"`).
jcrist deleted the json-dict-int-keys branch
December 17, 2022 19:29
Siyet
mentioned this pull request
Open
Labels
None yet