Consolidate `type[]` types in a union when displaying them
When displaying a union (e.g. in error messages or on hover), it would be nicer if we displayed the union type[A] | type[B] | type[C] as type[A | B | C]. The latter means the same thing, is a valid type annotation, and is much more concise. This would be similar to the way we display Literal["a"] | Literal[42] | Literal[b"foooo"] as Literal["a", 42, b"foo"] in diagnostics and on hover.
Keeping type display concise where possible makes our diagnostics much more readable.
Hi @AlexWaygood , I'd like to work on this issue.
@mahiro72 go for it!
Please ping us if you need a hand with anything :-)