Multiple instances and wrong parental links

John Nagle nagle at animats.com
Sun Jan 2 02:21:53 EST 2011


On 1/1/2011 9:57 PM, ChasBrown wrote:
> setattr(Wrap, 'stuff', ElementList(self, 'test'))

Right.  As the previous poster wrote, that line is the
basic problem.

It's not entirely clear what you're trying to do, but it
seems to be overly complex.  You could have Wrap inherit
from ElementList, if you want each Wrap class to be a
subclsss of ElementList.  Or simply have a line in the __init__
of Wrap like

    self.something = ElementList(self, whatever)

					John Nagle




More information about the Python-list mailing list