mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Add __getitem__() handler for use by visitContinue()
This commit is contained in:
parent
7c10008917
commit
4bd4dddd55
2 changed files with 4 additions and 0 deletions
|
|
@ -39,6 +39,8 @@ def push(self, elt):
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ def push(self, elt):
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue