human
Best way to encode tuples with json
assistant
Here is some code to serialize dictionary `d` as a JSON formatted string with each key formatted to pattern '%d,%d'

simplejson.dumps(dict([('%d,%d' % k, v) for k, v in list(d.items())]))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.