# Bug report ### Bug description: ```python import io import json class BadDict(dict): def __len__(self) -> int: return 1 class BadList(list): def __len__(self) -> int: return 1 fp = io.StringIO() json.dump([BadDict(), BadList()], fp, indent=4) print(fp.getvalue()) ``` ```json [ { }, ] ] ``` ### CPython versions tested on: 3.12 ### Operating systems tested on: Windows
Bug report
Bug description:
[ { }, ] ]CPython versions tested on:
3.12
Operating systems tested on:
Windows