Description
I am a bit confused by the behaviour of natural language containers. Currently, list of list of str
is not valid, but arguably more convoluted alternatives like list of (int, list of int)
->list[int, list[int]]
(not sure this is a valid type hint) or list of (str or list of str)
->list[str | list[str]]
are.
I think this comes from the "of qualname" piece in qualname "of" qualname _PLURAL_S?
as opposed to "of type" but then there is also qualname "of" "(" union ")"
with union
being defined with type, not qualname and also the tuple version qualname "of" "(" type ("," type)+ ")"
also with type instead of qualname.
I do have some list of list of str
but I completely understand that nesting these types too much becomes incomprehensible so we want to discourage users from such patterns. I am not sure what some good alternatives could be, but I think the current situation has the potential to be quite confusing.