1.1 --- a/micropython/inspect.py Mon Oct 14 00:07:56 2013 +0200
1.2 +++ b/micropython/inspect.py Tue Oct 15 00:20:01 2013 +0200
1.3 @@ -1401,6 +1401,10 @@
1.4
1.5 visitRightShift = _visitOperator
1.6
1.7 + def visitSet(self, node):
1.8 + self.use_specific_attribute("__builtins__", "set")
1.9 + return self.OP(node)
1.10 +
1.11 def visitSlice(self, node):
1.12 return self._visitOperator(node, self.in_assignment and "AssSlice" or "Slice")
1.13
2.1 --- a/micropython/report.py Mon Oct 14 00:07:56 2013 +0200
2.2 +++ b/micropython/report.py Tue Oct 15 00:20:01 2013 +0200
2.3 @@ -1407,6 +1407,18 @@
2.4 def visitRightShift(self, node):
2.5 self._visitBinary(node, ">>")
2.6
2.7 + def visitSet(self, node):
2.8 + self._span_start("set")
2.9 + self.stream.write("[")
2.10 + first = True
2.11 + for n in node.nodes:
2.12 + if not first:
2.13 + self.stream.write(", ")
2.14 + self.dispatch(n)
2.15 + first = False
2.16 + self.stream.write("]")
2.17 + self._span_end()
2.18 +
2.19 def visitSlice(self, node):
2.20 self._span_start("slice")
2.21 self.dispatch(node.expr)
3.1 --- a/micropython/syspython.py Mon Oct 14 00:07:56 2013 +0200
3.2 +++ b/micropython/syspython.py Tue Oct 15 00:20:01 2013 +0200
3.3 @@ -1084,6 +1084,9 @@
3.4 def visitRightShift(self, node):
3.5 return self._visitBinary(node)
3.6
3.7 + def visitSet(self, node):
3.8 + return compiler.ast.Set([self.dispatch(n) for n in node.nodes])
3.9 +
3.10 def visitSlice(self, node, expr=None):
3.11 return compiler.ast.CallFunc(
3.12 special_name("apply"),