It's still worth discussing -- that issue is still open. @vanburgerberg posted a workaround that relies on an undocumented feature of mypy, so there's definitely room for better support from the type system here. In particular, recursive unions like those needed to define JSON object types would be useful for all sorts of data structures, notably binary trees!Perhaps this thread should be renamed "Recursive types".On Tue, Aug 10, 2021, at 5:46 PM, Jelle Zijlstra wrote:El mar, 10 ago 2021 a las 14:37, Artemis (<artemisdev21+python-ideas@gmail.com>) escribió:Very often while writing web-related scripts, I have a function that either accepts or returns some arbitrary JSON data.Sometimes I know that this will be an object, so I annotate it as `dict[str, Any]` - which isn't quite accurate, since the values can't be `Any`. Sometimes I'm feeling lazy and annotate it as `dict[str, Any]` even when it may be any other JSON type.Very occasionally do I go to the effort of making something more accurate, maybeJsonData = Union[dict[str, 'JsonData'], list['JsonData'], int, float, bool, None]I think adding something like this called `Json`, `JsonData`, `JsonEncodable` or similar to `typing` or `json` would be very helpful for people working with web APIs. Perhaps a `JsonObject`/`JsonDict` aliased to `dict[JsonData]` and a `JsonArray`/`JsonList` aliased to `list[JsonData]` (like in Java) would also be helpful.This has previously been discussed in great detail in https://github.com/python/typing/issues/182 ._______________________________________________Typing-sig mailing list -- typing-sig@python.orgTo unsubscribe send an email to typing-sig-leave@python.orgMember address: jelle.zijlstra@gmail.com_______________________________________________Typing-sig mailing list -- typing-sig@python.orgTo unsubscribe send an email to typing-sig-leave@python.orgMember address: rbt@sent.as_______________________________________________Typing-sig mailing list -- typing-sig@python.orgTo unsubscribe send an email to typing-sig-leave@python.orgMember address: pbryan@anode.ca