Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4bd4ddd

Browse files
committed
Add __getitem__() handler for use by visitContinue()
1 parent 7c10008 commit 4bd4ddd

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/compiler/misc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def push(self, elt):
3939
self.stack.append(elt)
4040
def top(self):
4141
return self.stack[-1]
42+
def __getitem__(self, index): # needed by visitContinue()
43+
return self.stack[index]
4244

4345
MANGLE_LEN = 256 # magic constant from compile.c
4446

Tools/compiler/compiler/misc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def push(self, elt):
3939
self.stack.append(elt)
4040
def top(self):
4141
return self.stack[-1]
42+
def __getitem__(self, index): # needed by visitContinue()
43+
return self.stack[index]
4244

4345
MANGLE_LEN = 256 # magic constant from compile.c
4446

0 commit comments

Comments
 (0)