[BangPypers] class inheritance query

alind sharma alind_sap at yahoo.com
Wed Feb 29 12:23:06 CET 2012

I think that X, Y, Z all inheriting from A will solve your problem. 

Alind Sharma

 From: Nitin Kumar <nitin.nitp at gmail.com>
To: Bangalore Python Users Group - India <bangpypers at python.org> 
Sent: Wednesday, 29 February 2012 12:38 PM
Subject: [BangPypers] class inheritance query
Hi All,

Let say I have some classes X,Y and Z with some static values

class X:

class Y:

class Z:

Now I want to have class A such that it can have variables from class Y or
Z (any one only) depending on runtime so that while using i can use

X.a and X.b     or      X.a and X.c

how can i implement this using property or metaclass or any other idea is

Nitin K
BangPypers mailing list
BangPypers at python.org

More information about the BangPypers mailing list