What you wrote is you want a GameObject
to be both a Player
and an Enemy
. But an Enemy
is already a Player
. The MRO issue just states that if you had a field a
in Player
, asking for this field in a GameObject
instance would be ambiguous: should it be the a
from the first Player
you inherit or the one from the Player
you inherit through your Enemy
inheritance?
But are you sure you don't want to use composition instead of inheritance, here?
class GameObject(object):
def __init__(self):
self.player = Player()
self.enemy = Enemy()