Question : Python list: Object vs. Instance

Hi Experts,

I am writing a Python code (http://www.experts-exchange.com/Programming/Languages/Scripting/Python/Q_23281421.html#a21243422, but I have met the following error indication.

 File "/usr/lib/python2.3/site-packages/ahocorasick/__init__.py",  in savemap
    list.append (part)
TypeError: descriptor 'append' requires a 'list' object but received a 'instance'

I also attach the part of code.

Anybody knows how to fix it?
Thanks a lot!
Code Snippet:
1:
2:
3:
4:
5:
6:
List = []
                part = KeywordPart.KeywordPart(parts[1], serialno, len(tokens), token_index)
                list.append(part)
 
                self.dic[tokens[token_index]] = list
                print 'Create map file::' , tokens[token_index]
Open in New Window Select All

Answer : Python list: Object vs. Instance

Just a note (I do not want your points): Prefer not to use the "list" identifier for your objects as it is the built-in function.

I am curious if you are able to accept your own solution with refunding the points. Earlier, it was only possible to delete the question... unless someone else added a comment. In such case the following from the above help had to be done:

"Post a request in the Community Support Zone asking for a refund, and asking the Moderators to close the question;"
Random Solutions  
 
programming4us programming4us