Sorry for the misunderstanding - I really didn't mean that as part of the overall solution, only to point out the immediate source of the error message. More explicitly, this:
>>> aList = list()
>>> aList.append(1)
>>>
>>> # not allowed:
>>> aList(0)
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
aList(0)
TypeError: 'list' object is not callable
>>>
>>> # allowed:
>>> aList[0]
1
>>>
>>> # or:
>>> for item in aList:
print item
1
>>>
My 2nd point about the infinite loop was just that even if you didn't get that error, your loop that would have been entered would be a process you'd have to kill (unless the lists were identical), because the item is being added to your list so that the 'not in' logic would never evaluate false...if that now makes sense?Sorry for the confusion...if I have anything else to contribute later, it'll be more toward the overall solution, lol!WayneEdit:This is important to see, about infinite loop situation:
>>> lstChanged = [1,2,3]
>>> lstDoubleCheck = [1,2]
>>>
>>> for item in lstChanged:
if item not in lstDoubleCheck: # error fixed here
lstChanged.append(item) # new error introduced here
if len(lstChanged) == 20: # for demo purposes, forced a break
break
>>> # so here's what we have:
>>> print lstChanged
[1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
>>> # the integer item '3' would have been appended infinitely.