这是一个可以用Sequence[Sequence[str]]
注释的值的典型示例:
[
['This', 'is', 'the', 'first', 'tokenized', 'sentence', '.'],
['And', 'this', 'is', 'the', 'second', 'one', '.'],
]
我已经知道了string is a valid type for annotation Sequence[str]
个,从宽松地说,在Python世界里,有strings are sequences of strings个.Does that work recursively?字符串是否也是批注Sequence[Sequence[str]]
等的有效类型?
我会说yes,遵循Python逻辑,但我会说no,遵循常识.我不知道如何正确地测试它.