Sorry but you have misinterpreted this. JSON is a string representation of data. In python json.dumps will wrap your data in a string ''
In other words, it did not "work" in the code below. The list is not "stringified", it is simply encapsuled in a string ''
.
In [2]: json.dumps(['a', 'b', 'c'])
Out[3]: '["a", "b", "c"]'
A more correct way to compare the results would be to print the json.dumps (as this is how the data will be interpreted when loaded back.
Meaning you should compare (these are the printed versions of above):
{"dic": ["a", "b", "c"]} <--> ["a", "b", "c"]
summary: You have a correctly encoded JSON.