mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Make sre's SubPattern objects accept slice objects like it already accepts
simple slices.
This commit is contained in:
		
							parent
							
								
									ab4b873f81
								
							
						
					
					
						commit
						e3a985fe9a
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -134,6 +134,8 @@ def __len__(self): | ||||||
|     def __delitem__(self, index): |     def __delitem__(self, index): | ||||||
|         del self.data[index] |         del self.data[index] | ||||||
|     def __getitem__(self, index): |     def __getitem__(self, index): | ||||||
|  |         if isinstance(index, slice): | ||||||
|  |             return SubPattern(self.pattern, self.data[index]) | ||||||
|         return self.data[index] |         return self.data[index] | ||||||
|     def __setitem__(self, index, code): |     def __setitem__(self, index, code): | ||||||
|         self.data[index] = code |         self.data[index] = code | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thomas Wouters
						Thomas Wouters