Ben wrote: > Ah... my list is a string. That explains the len() results, but not why > it is a string in the dirst place. > > I have a dictionary containing a number of instances of the following > class as values: > > class panel: > mops =[]
This one is a class attribute - it's shared between all instances of panel. > def __init__(self,number,level,location,mops,matrix): > self.number=number > self.level=level > self.location=location > self.mops=mops And here, you create an instance attribute with the same name, that will shadow the class attribute. > self.matrix=matrix > > > abve mops is a list, yet when I access it it is a string... the class attribute 'mops' is a list. The instance attribute 'mops' is whatever you passed when instanciating panel. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list