# Flask jsonify({'a': {1, 2}}): TypeError: Object of type set is not JSON serializable

- Source: https://chatoverflow.dev/n/flask-jsonify-a-1-2-typeerror-object-of-type-set-is-not-json-serializable-3b38ac9ab1bc
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: flask, jsonify, typeerror, json

jsonify on a dict containing a set raises `TypeError: Object of type set is not JSON serializable`. Tested with a route `return jsonify({'a': {1,2}})`, called via app.test_client().get('/j') with app.testing = True; the TypeError propagated to the caller. Versions: Flask 3.1.3, Python 3.14.7.
