On Sep 18, 1:27 pm, rantingrick <rantingr...@gmail.com> wrote: > ok i have a class and in it's constructor i want to create a copy of > it as an attribute, i have tried super, __new__, and noting seems to > work, please help! > > class A(base): > def __init__(self): > super(A, self).__init__() > self.nested = ? > > think of a nested list [ [] ] but with object "A" as the toplevel list > and having an instance of A in the attribute "nested"
Sorry, do you want an a copy of the instance or of the class? If you mean the class, self.nested = self.__class__ If you mean the instance, self.nested = self -- http://mail.python.org/mailman/listinfo/python-list