Skip to content

gh-110941: Fix json.dump encoding dict subclasses as empty (continued)#150631

Open
eendebakpt wants to merge 6 commits into
python:mainfrom
eendebakpt:json_dict_subclass_gh110941
Open

gh-110941: Fix json.dump encoding dict subclasses as empty (continued)#150631
eendebakpt wants to merge 6 commits into
python:mainfrom
eendebakpt:json_dict_subclass_gh110941

Conversation

@eendebakpt
Copy link
Copy Markdown
Contributor

@eendebakpt eendebakpt commented May 30, 2026

This is a continuation of #111036 which has stalled. The PR is the same, exact that we only handle the fast path for exact dicts. This keeps the code a bit cleaner.

aljungberg and others added 6 commits October 18, 2023 13:17
See python#110941 for full details but the tldr is that the C optimised JSON encoder did not handle `dict` subclasses correctly and encoded them as empty if they did not put something into `super()`'s storage.
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants