Add __getitem__() handler for use by visitContinue()

This commit is contained in:
Jeremy Hylton 2001-08-29 22:26:35 +00:00
parent 7c10008917
commit 4bd4dddd55
2 changed files with 4 additions and 0 deletions

View File

@ -39,6 +39,8 @@ class Stack:
self.stack.append(elt) self.stack.append(elt)
def top(self): def top(self):
return self.stack[-1] return self.stack[-1]
def __getitem__(self, index): # needed by visitContinue()
return self.stack[index]
MANGLE_LEN = 256 # magic constant from compile.c MANGLE_LEN = 256 # magic constant from compile.c

View File

@ -39,6 +39,8 @@ class Stack:
self.stack.append(elt) self.stack.append(elt)
def top(self): def top(self):
return self.stack[-1] return self.stack[-1]
def __getitem__(self, index): # needed by visitContinue()
return self.stack[index]
MANGLE_LEN = 256 # magic constant from compile.c MANGLE_LEN = 256 # magic constant from compile.c