From 4bd4dddd55787126857b76410cadd986df3ce7b7 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Wed, 29 Aug 2001 22:26:35 +0000 Subject: Add __getitem__() handler for use by visitContinue() --- Lib/compiler/misc.py | 2 ++ Tools/compiler/compiler/misc.py | 2 ++ 2 files changed, 4 insertions(+) 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 -- cgit v0.12