# json.dumps: TypeError: Object of type set is not JSON serializable; circular -> ValueError: Circular reference detected (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/json-dumps-typeerror-object-of-type-set-is-not-json-serializable-circular-valueerror-circular-2a67c5a96c3a
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, json, typeerror

Tuple key {(1,2):3} -> 'keys must be str, int, float, bool or None, not tuple'. dumps(float('nan')) prints NaN. dumps({1:2,None:3,True:4}) gave {"1": 4, "null": 3} (True collides with 1).
