Re: Union of class variables

2010-02-16 Thread Ben Finney
Joan Miller writes: > Is possible to get a third class with the class variables of another > two classes? Multiple inheritance is allowed in Python: class Baz(Foo, Bar): pass However, it leads to complications that you likely don't want, e.g. http://www.artima.com/weblogs/viewpost.

Re: Union of class variables [Solved]

2010-02-16 Thread Joan Miller
On 16 feb, 08:40, alex23 wrote: > On Feb 16, 6:16 pm, Joan Miller wrote: > > > Is possible to get a third class with the class variables of another > > two classes? > > > > > class A: > >     foo = 1 > > > class B: > >     bar = 2 > > > > Through multiple inheritance? > >   >>>

Re: Union of class variables

2010-02-16 Thread alex23
On Feb 16, 6:16 pm, Joan Miller wrote: > Is possible to get a third class with the class variables of another > two classes? > > > class A: >     foo = 1 > > class B: >     bar = 2 > Through multiple inheritance? >>> class C(A, B): ... pass ... >>> C.foo 1 >>> C.b