Computer Science, asked by padmalm8438, 1 year ago

How can I preserve Python tuples with JSON?

Answers

Answered by raghav208
0

There is no concept of a tuple in the JSON format. Python's json module converts Python tuples to JSON lists because that's the closest thing in JSON to a tuple. Immutability will not be preserved. If you want to preserve them, use a utility like pickle or write your own encoders and decoders

Similar questions