I\'m still a little new to this, so I might not know all the conventional terms for things:
Is it possible to preserve Python tuples when encoding with JSON? Right
The principal difference between python lists and tuples is mutability, which is irrelevant to JSON representations, as long as you're not contemplating modifying the internal members of the JSON list while it's in text form. You can just turn the lists you get back into tuples. If you're not using any custom object decoders, the only structured datatypes you have to consider are JSON objects and arrays, which come out as python dicts and lists.
def tuplify(listything):
if isinstance(listything, list): return tuple(map(tuplify, listything))
if isinstance(listything, dict): return {k:tuplify(v) for k,v in listything.items()}
return listything
If you are specializing the decoding, or want some JSON arrays to be python lists and others to be python tuples, you'll need to wrap data items in a dict or tuple that annotates type information. This in itself is a better way to influence an algorithm's control flow than branching based on whether something is a list or tuple (or some other iterable type).