How can I preserve Python tuples with JSON?
Answers
Answered by
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