Python 2.6.7; Windows 7python Ошибка атрибута при инициализации объекта
Решите задачу Deitel 'Simple Compiler' в python. Репозиторий по адресу github. Написание тестового набора.
module compiler.py
class SCompiler(object) :
RAMSIZE = 100
# more static attributes
def __init__(self) :
self.symbolTable = [ TableEntry() ] * SCompiler.RAMSIZE
self.lineFlags[ -1 ] * SCompiler.RAMSIZE
# more initializations
Stack trace.
File "testCompiler.py", line 45, in <module>
tool = compiler.SCompiler()
File "absolutePath\compiler.py", line 37, in `__init__`
self.lineFlags[ -1 ] * SCompiler.RAMSIZE
AttributeError: 'SCompiler' object has no attribute 'lineFlags'
Я не уверен, что есть, чтобы опечатать здесь. Файл «compiler.py» компилируется автоматически. TableEntry - это еще один класс в файле. Спасибо за ваш совет.