This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any, Dict, List, Mapping, Union | |
# Values for JSON that aren't nested | |
JSON_v = Union[str, int, float, bool, None] | |
# If MyPy ever permits recursive definitions, just uncomment this: | |
# JSON = Union[List['JSON'], Mapping[str, 'JSON'], JSON_v] | |
# Until then, here's a multi-layer way to represent any (reasonable) JSON we | |
# might send or receive. It terminates at JSON_4, so the maximum depth of |