Types 创建类时出现TypeError

Types 创建类时出现TypeError,types,typeerror,python-3.4,Types,Typeerror,Python 3.4,今天,出现了一些意想不到的行为。当我写这篇文章时: class ErrorPost(object): def __init__(self, message): self.message = "[Error]" + message print(self.message) del self class ErrorLog(ErrorPost): def __init__(self, message): super()._

今天,出现了一些意想不到的行为。当我写这篇文章时:

class ErrorPost(object):
    def __init__(self, message):
        self.message = "[Error]" + message
        print(self.message)
        del self

class ErrorLog(ErrorPost):
    def __init__(self, message):
        super().__init__(message)
        del self
此代码在创建ErrorLog对象时引发错误:

TypeError: 'type' object is not subscriptable
为什么会这样?我没有操纵任何东西的类型,也没有试图将一个对象转换为另一种类型,例如int。这里发生了什么

对不起,我可以发布的代码数量有限

完整堆栈跟踪:

C:\Python33\python.exe C:/Users/******/Documents/MalwareTycoon/main.py
Traceback (most recent call last):
  File "C:/Users/******/Documents/MalwareTycoon/main.py", line 151, in generate_network
    ********Dict[self.*********] = ***(self.available*****Dict[randint])
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/******/Documents/MalwareTycoon/main.py", line 201, in <module>
    Game = Game()
Image loaded: C:/Users/******/Documents/MalwareTycoon\images\background.PNG
  File "C:/Users/******/Documents/MalwareTycoon/main.py", line 58, in __init__
    self.computers = self.generate_network()
  File "C:/Users/******/Documents/MalwareTycoon/main.py", line 153, in generate_network
    errorLog= ErrorLog["Apple Computers needed, but no OS available"]
TypeError: 'type' object is not subscriptable

Process finished with exit code 1
C:\Python33\python.exe C:/Users/*****/Documents/MalwareTycoon/main.py
回溯(最近一次呼叫最后一次):
文件“C:/Users/*****/Documents/MalwareTycoon/main.py”,第151行,在generate_网络中
********Dict[self.*********]=***(self.available******Dict[randint])
索引器:列表索引超出范围
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“C:/Users/*****/Documents/MalwareTycoon/main.py”,第201行,在
游戏
加载的图像:C:/Users/*****/Documents/MalwareTycoon\images\background.PNG
文件“C:/Users/********/Documents/MalwareTycoon/main.py”,第58行,在__
self.computers=self.generate_network()
文件“C:/Users/*****/Documents/MalwareTycoon/main.py”,第153行,在generate_网络中
errorLog=errorLog[“需要苹果电脑,但没有可用的操作系统”]
TypeError:“type”对象不可下标
进程已完成,退出代码为1
你用了括号。创建对象时需要使用括号:

errorLog= ErrorLog("Apple Computers needed, but no OS available")

你能发布完整的堆栈跟踪吗?还有,为什么要删除self?这完全没有意义。真的。。。。无聊的。。。。。我会尽可能多地发布,给我一秒@user2357112
errorLog= ErrorLog("Apple Computers needed, but no OS available")