艰难学习Python - 练习43 - TypeError:object()不带参数

时间:2015-09-27 19:54:39

标签: python

我从LPTHW Exercise 43输入了此代码。这似乎与练习相同。我已经检查过以确保我没有混淆空格和标签。 (我使用了标签)。

尝试运行时出现以下错误。

TypeError: object() takes no parameters

当我从课程中复制并粘贴代码时,它运行正常。我对这两个文件进行了文本比较,但没有找到差异。

class Scene(object):

    def enter(self):
        pass


class Engine(object):

    def _init_(self, scene_map):
        pass

    def play(self):
        pass

class Death(Scene):

    def enter(self):
        pass

class CentralCorridor(Scene):

    def enter(self):
        pass

class LaserWeaponArmory(Scene):

    def enter(self):
        pass

class TheBridge(Scene):

    def enter(self):
        pass

class EscapePod(Scene):

    def enter(self):
        pass


class Map(object):

    def _init_(self, start_scene):
        pass

    def next_scene(self, scene_name):
        pass

    def opening_scene(self):
        pass


a_map = Map('central corridor')

a_game = Engine(a_map)

a_game.play()enter code here

1 个答案:

答案 0 :(得分:4)

{{1}}有两个下划线字符!