That's the kind of projects I love to see. Actually socially useful :) Keep it up!
JSONObject = None | str | int | bool | list["JSONObject"] | dict[str, "JSONObject"]
# this type checks
a: JSONObject = {"a": [1, 2, "7", True, {"false": None}]}
# this doesn't type check
b: JSONObject = {"a": [1, 2, "7", True, {"false": object()}]} from typing import TypeVar
T, U, V, W = TypeVar('T'), TypeVar('U'), TypeVar('V'), TypeVar('W')
def concatenate(a: tuple[T, U], b: tuple[V, W]) -> tuple[T, U, V, W]:
return a + b
For the generic type transformation example, I'm not sure what you mean: from typing import Any, Callable
Transformer = Callable[[dict[str, Any]], dict[Callable, Any]]
This seems to match your question but it's really weird.