newbie: copy base class fields

tmp123 tmp123 at menta.net
Sun May 6 10:46:06 EDT 2007


On May 3, 4:57 pm, "Jerry Hill" <malaclyp... at gmail.com> wrote:
> 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
>

Thanks a lot for the answers, they seem to agree with the requested
funcitionality.

Kind regards.




More information about the Python-list mailing list