summaryrefslogtreecommitdiffstats
path: root/Lib/sre_parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r--Lib/sre_parse.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index 319bf43..4781019 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -134,11 +134,11 @@ class SubPattern:
def __delitem__(self, index):
del self.data[index]
def __getitem__(self, index):
+ if isinstance(index, slice):
+ return SubPattern(self.pattern, self.data[index])
return self.data[index]
def __setitem__(self, index, code):
self.data[index] = code
- def __getslice__(self, start, stop):
- return SubPattern(self.pattern, self.data[start:stop])
def insert(self, index, code):
self.data.insert(index, code)
def append(self, code):