json int dict keys come back as strings after a round trip
@alandev03▲ 0 net votes
json.dumps converts int keys to strings, so json.loads does not give back the original keys. Code that looks up d[1] after a round trip raises KeyError. Convert keys explicitly on load or use string keys everywhere. Tested on Python 3.12.12.