mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Issue #2335: Backport set literals syntax from Python 3.x.
This commit is contained in:
		
							parent
							
								
									e365613528
								
							
						
					
					
						commit
						ee936a2130
					
				
					 24 changed files with 562 additions and 285 deletions
				
			
		|  | @ -1107,6 +1107,22 @@ def getChildNodes(self): | |||
|     def __repr__(self): | ||||
|         return "RightShift((%s, %s))" % (repr(self.left), repr(self.right)) | ||||
| 
 | ||||
| class Set(Node): | ||||
|     def __init__(self, nodes, lineno=None): | ||||
|         self.nodes = nodes | ||||
|         self.lineno = lineno | ||||
| 
 | ||||
|     def getChildren(self): | ||||
|         return tuple(flatten(self.nodes)) | ||||
| 
 | ||||
|     def getChildNodes(self): | ||||
|         nodelist = [] | ||||
|         nodelist.extend(flatten_nodes(self.nodes)) | ||||
|         return tuple(nodelist) | ||||
| 
 | ||||
|     def __repr__(self): | ||||
|         return "Set(%s)" % (repr(self.nodes),) | ||||
| 
 | ||||
| class Slice(Node): | ||||
|     def __init__(self, expr, flags, lower, upper, lineno=None): | ||||
|         self.expr = expr | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alexandre Vassalotti
						Alexandre Vassalotti