SLinkedList 对象不可调用

SLinkedList object is not callable

我很好奇为什么这段代码在终端中运行良好,但在 spyder 中却抛出错误 TypeError: 'SLinkedList' object is not callable

from itertools import combinations
l1 = [1,2,3,4]
result = []
for i in range(len(l1)+1):
        c = combinations(l1, i)
        for j in c:
                #type(j) is <class 'tuple'>
                result.append(list(j)) #error on doing list(j)

print(result)

提前致谢。

检查您是否正在覆盖完整源代码中其他地方的“list”对象。

>>> list = [1,2,3,4]
>>> tup = (1,2,3)
>>> print(list(tup))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list' object is not callable
>>>