Kaydet (Commit) e3a985fe authored tarafından Thomas Wouters's avatar Thomas Wouters

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

simple slices.
üst ab4b873f
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment