mirror of
https://github.com/python/cpython.git
synced 2025-09-16 13:47:31 +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 @@ class RightShift(Node):
|
|||
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