>>> inverseIndex={'p':{1,2,3},'a':{2,3,4},'v':{5,6,7}}
>>> query={'p','a','v'}
>>> s=[inverseIndex[s] for s in query]
>>> s
[{2, 3, 4}, {1, 2, 3}, {5, 6, 7}]
>>> [ s[len(s)-1].update(s[i]) for i in range(len(s)-1) ]
[None, None]
为什么片段会[None,None]
作为输出产生?我期待着[{2, 3, 4}, {1, 2, 3}, {1,2,3,4,5,6,7}]
。