class initialization problem

rantingrick rantingrick at
Fri Sep 18 05:27:47 CEST 2009

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"

More information about the Python-list mailing list