This is a typical example of a value that can be annotated by Sequence[Sequence[str]]
:
[ ['This', 'is', 'the', 'first', 'tokenized', 'sentence', '.'], ['And', 'this', 'is', 'the', 'second', 'one', '.'],]
I have learned that string is a valid type for annotation Sequence[str]
, since, loosely speaking, strings are sequences of strings in the Python world. Does that work recursively? Is string also a valid type for annotation Sequence[Sequence[str]]
etc.?
I'd say yes, following the Python logic, but I'd say no, following the common sense. And I don't know how to properly test it.