class Contact(DictMixin): def __init__ (self, name,parent=const.modelRootNode, avatar=None): ... self.children=[] self.parent=parent if self.parent != const.modelRootNode : self.parent.children.sort(lambda x,y: cmp(x["name"],y["name"])) def getParent(self): return self.parent ... contacts.append( Contact(name="User 1",parent=notInListGr,avatar="resources/av1.png" ) ) получаю на выходе ~/crabim> python main.py PyQt4.QtCore.QPoint(1279, 992) Traceback (most recent call last): File "main.py", line 91, in main() File "main.py", line 69, in main contacts = ContactDB() #in future: c contactDB(settings.getContactDBfilename()) File "/home/fermer/crabim/modules/contacts.py", line 26, in __init__ self.contacts.append( Contact(name="User 1",parent=notInListGr,avatar="resources/av1.png" ) ) File "/home/fermer/crabim/modules/contacts.py", line 61, in __init__ if self.parent != const.modelRootNode : File "/usr/lib64/python2.6/UserDict.py", line 177, in __cmp__ return cmp(dict(self.iteritems()), other) File "/usr/lib64/python2.6/UserDict.py", line 109, in iteritems for k in self: File "/usr/lib64/python2.6/UserDict.py", line 96, in __iter__ for k in self.keys(): TypeError: keys() takes no arguments (1 given)