mirror of https://github.com/python/cpython
Make sre's SubPattern objects accept slice objects like it already accepts
simple slices.
This commit is contained in:
parent
ab4b873f81
commit
e3a985fe9a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue