Exemplo n.º 1
0
 def visit_Dict(self, node):
     keys = map(self.visit, node.keys)
     values = map(self.visit, node.values)
     pairs = [
         sage.buildKeyDatumPair(keys[i], values[i])
         for i in range(len(keys))
     ]
     return sage.buildDict(pairs)
Exemplo n.º 2
0
 def visit_DictComp(self, node):
     key = self.visit(node.key)
     value = self.visit(node.value)
     elt = sage.buildKeyDatumPair(key, value)
     gens = sage.buildExprListExp(map(self.visit, node.generators))
     return sage.buildDictComp(elt, gens)
Exemplo n.º 3
0
 def visit_DictComp(self, node):
   key = self.visit(node.key)
   value = self.visit(node.value)
   elt = sage.buildKeyDatumPair(key, value)
   gens = sage.buildExprListExp(map(self.visit, node.generators))
   return sage.buildDictComp(elt, gens)
Exemplo n.º 4
0
 def visit_Dict(self, node):
   keys = map(self.visit, node.keys)
   values = map(self.visit, node.values)
   pairs = [sage.buildKeyDatumPair(keys[i], values[i]) for i in range(len(keys))]
   return sage.buildDict(pairs)