4 ms·
You can. from typing import Dict, List JSON = Dict[str, 'JSON'] | List['JSON'] | float | int | str | None I would say the only thing ugly here is the st
by corethree 3y ago
You can.
from typing import Dict, List
JSON = Dict[str, 'JSON'] | List['JSON'] | float | int | str | None
I would say the only thing ugly here is the string 'JSON' that is used for recursion. From a static safety perspective with an external type checker the static safety effect is identical.