summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 22:26:35 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 22:26:35 (GMT)
commit4bd4dddd55787126857b76410cadd986df3ce7b7 (patch)
treeed4a9185c69006db1d301750a218fe68601d6ebf
parent7c10008917059610930f2122017e752ac7bc1ba5 (diff)
downloadcpython-4bd4dddd55787126857b76410cadd986df3ce7b7.zip
cpython-4bd4dddd55787126857b76410cadd986df3ce7b7.tar.gz
cpython-4bd4dddd55787126857b76410cadd986df3ce7b7.tar.bz2
Add __getitem__() handler for use by visitContinue()
-rw-r--r--Lib/compiler/misc.py2
-rw-r--r--Tools/compiler/compiler/misc.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/Lib/compiler/misc.py b/Lib/compiler/misc.py
index b834a2e..9cbd73f 100644
--- a/Lib/compiler/misc.py
+++ b/Lib/compiler/misc.py
@@ -39,6 +39,8 @@ class Stack:
self.stack.append(elt)
def top(self):
return self.stack[-1]
+ def __getitem__(self, index): # needed by visitContinue()
+ return self.stack[index]
MANGLE_LEN = 256 # magic constant from compile.c
diff --git a/Tools/compiler/compiler/misc.py b/Tools/compiler/compiler/misc.py
index b834a2e..9cbd73f 100644
--- a/Tools/compiler/compiler/misc.py
+++ b/Tools/compiler/compiler/misc.py
@@ -39,6 +39,8 @@ class Stack:
self.stack.append(elt)
def top(self):
return self.stack[-1]
+ def __getitem__(self, index): # needed by visitContinue()
+ return self.stack[index]
MANGLE_LEN = 256 # magic constant from compile.c