On 3 May 2007 07:14:04 -0700, tmp123 <[EMAIL PROTECTED]> wrote: > Of course, it is not an option to copy one by one all the fields of > class A inside the __init__ of B.
Is it okay to copy them all at once? Like this:
class B(A):
def __init__(self, a):
self.__dict__.update(a.__dict__)
self.v2 = 2
That will copy all of the attributes of instance a into the new instance.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
