Suppose that I have the following python base class:
Classclass BaseClass(object):
def Aa():
# **this"""This method uses method Bb(), defined in the inheriting class**class"""
And also a class that inherites BaseClass:
Classclass UsedByUser(BaseClass):
def Bb():
# B"""b() is defined here, yet is used by the base classclass"""
My user would only create instances of class UsedByUser. Typical use would be:
if (__name__ __name__=='__main__'== )'__main__':
# initialize the class used by the user
usedByUser = UsedByUser()
# invoke method Aa()
usedByUser.Aa()
My questions is, is the above use problematic? is this a valid approach, or must I also define method Bb() in BaseClass() and then override it in UsedByUser(BaseClass)?