Skip to content

Instantly share code, notes, and snippets.

@jhenly
Created February 5, 2024 20:16
Show Gist options
  • Select an option

  • Save jhenly/3c84f1fc477b36b7fd5c53a61fd08d90 to your computer and use it in GitHub Desktop.

Select an option

Save jhenly/3c84f1fc477b36b7fd5c53a61fd08d90 to your computer and use it in GitHub Desktop.
A few handy JSON types.
""" Includes a few handy JSON types.
```
JsonPrimitive = str | int | float | bool | None
Json = JsonPrimitive | dict[str, 'Json'] | list['Json']
JsonObject = dict[str, Json]
JsonArray = list[Json]
```
"""
__all__ = (
'Json',
'JsonArray',
'JsonObject',
'JsonPrimitive',
)
JsonPrimitive = str | int | float | bool | None
Json = JsonPrimitive | dict[str, 'Json'] | list['Json']
JsonObject = dict[str, Json]
JsonArray = list[Json]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment