[BangPypers] Help required to design classes

Saju M sajuptpm at gmail.com
Tue Oct 9 11:01:52 CEST 2012


I have two classes "A" and "B"

class A:
    def __init__(self, input):
        //do something on input

class B(A):
    def __init__(self, input):
        A.__init__(self, input)
        //do something

Then, I want to create two new classes "P" and "Q"

class P:
    def __init__(self, input):
        //do something different on input

class Q(p):
    def __init__(self, input):
        P.__init__(self, input)
        //do something

In class "Q", I want all the methods defined in class "B",  How do it?.
How redesign this class structure.
Note: constructor of class "A" and "B" doing different operations on input.
Note: But functionalities defined in class "B" should come in class "Q".

More information about the BangPypers mailing list