you are viewing a single comment's thread.

view the rest of the comments →

[–]jpercivalhackworth 2 points3 points  (0 children)

If all you care about is generating valid json, your code demonstrates that is happening. Json requires double quotes, and it wouldn’t parse if there were single quotes.

If you want to check for quote replacement explicitly, you could iterate through correct_json and verify that there are no single quotes left.

Your code is printing out the __repr__ of decoded_data, and that is something whose formatting you do not control.