def __str__(self): if len(self) == 0: return "{}" s = None for (key, val) in self.iteritems( ): if s is None: s = "{%s: %s" else: s += ", %s: %s" s = s % (quote_if(key), quote_if(val)) s += "}" return s
def __str__(self): if len(self) == 0: return "{}" s = None for (key, val) in self.iteritems(): if s is None: s = "{%s: %s" else: s += ", %s: %s" s = s % (quote_if(key), quote_if(val)) s += "}" return s
def _print_bindings(b): print "\nBindings: %s" % b print "Keys: ", for bkey in b.iterkeys(): print bkey, print print "Values: ", for bval in b.itervalues(): print quote_if(bval), print print "Items: ", for bitem in b.iteritems(): print bitem, print print "\n"