On May 11, 3:19 am, Francesco Bochicchio <[EMAIL PROTECTED]> wrote:
> But there is not such a thing, in Python. What you have is that A
> has the same attributes/methods of B plus its own.
> What you could do is  adding in class A a method like this:
>
>   class A(B):
>      ...
>      def set_b_attributes(self, instance_of_b):
>          for k, value in instance_of_b.__dict__:
>                 setattr(self, k, value )
>
> and the use it like this:
>
>    a1.set_b_attributes(b1)

Hi, Francesco.
    Thanx!  That's actually exactly what I needed (though I didn't
know it).
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to