关于类:无法导入Python类

Can't import classes Python

这是我的密码

1
2
3
4
5
class Game_Events(Setup, Game_Setup):
   def __init__(self):
      super(Game_Events, self).__init__()

      super(Game_Events, self).game_setup(self.map_filename)

但是当导入类时,我得到:

1
2
3
TypeError: Error when calling the metaclass bases
Cannot create a consistent method resolution
order (MRO) for bases Game_Setup, Setup

这是EDOCX1的初始值〔0〕:

1
2
3
4
5
class Setup(object):
   def __init__(self):
    self.HERO_MOVE_SPEED = 20  # pixels per second
    self.MAP_FILENAME = 'resources/tmx/Fesnoria Town.tmx'
    self.MUSIC_FILENAME ="resources/music/Forest_Song.mp3"

这是EDOCX1的初始值(1):

1
2
3
class Game_Setup(Setup):
    def __init__(self):
       super(Game_Setup, self).__init__()

我需要先导入Setup类,因为它包含了self.map_filename类,我需要它下面的另一个类。

有人知道怎么修理这个吗?


Game_SetupSetup的一个子类,但Game_Events继承了两者,这是不可能的。我想你应该只从江户那里继承1〔0〕才能使它发挥作用。