Make sre's SubPattern objects accept slice objects like it already accepts

simple slices.
This commit is contained in:
Thomas Wouters 2006-12-19 08:17:50 +00:00
parent ab4b873f81
commit e3a985fe9a
1 changed files with 2 additions and 0 deletions

View File

@ -134,6 +134,8 @@ 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