I'm sorry for my silly question, but... let's suppose I have these classes:
msg = 'hehehe'
msg = 'hohoho'
foo = B()
If the class is single-inherited:
foo = B() print foo.__class__.__bases__.msg # 'hehehe'
If the class is multiple-inherited, the question makes no sense because there may be multiple classes defining the 'msg', and they could all be meaningful. You'd better provide the actual parent (i.e.
A.msg). Alternatively you could iterate through all direct bases as described in @Felix's answer.