In your BaseB __init__ function you are calling the Child's authors, not the Parent's authors.
If you wish to call the Parent's authors you would use BaseB.authors instead of self.authors:
class BaseA(object):
authors = ['a', 'b']
author_list = authors
class BaseB(object):
authors = ['a', 'b']
def __init__(self, *arg, **kwargs):
self.author_list = BaseB.authors
class ChildA(BaseA):
authors = ['c', 'd']
class ChildB(BaseB):
authors = ['c', 'd']
child_a = ChildA()
child_b = ChildB()
print(child_a.author_list)
print(child_b.author_list)
>>> ['a', 'b']
>>> ['a', 'b']
In the case where you would be concatenating the authors of the ParentB and the ChildB then you would use both BaseB.authors and self.authors:
class BaseA(object):
authors = ['a', 'b']
author_list = authors
class BaseB(object):
authors = ['a', 'b']
def __init__(self, *arg, **kwargs):
self.author_list = BaseB.authors + self.authors
class ChildA(BaseA):
authors = ['c', 'd']
class ChildB(BaseB):
authors = ['c', 'd']
child_a = ChildA()
child_b = ChildB()
print(child_a.author_list)
print(child_b.author_list)
>>> ['a', 'b']
>>> ['a', 'b', 'c', 'd']
Override
class BaseA(object):
authors = ['a', 'b']
author_list = authors
class BaseB(object):
authors = ['a', 'b']
def __init__(self, *arg, **kwargs):
self.author_list = self.authors
class ChildA(BaseA):
authors = ['c', 'd']
def __init__(self, *arg, **kwargs):
self.author_list = self.authors
class ChildB(BaseB):
authors = ['c', 'd']
child_a = ChildA()
child_b = ChildB()
print(child_a.author_list)
print(child_b.author_list)
>>> ['c', 'd']
>>> ['c', 'd']