◐ Shell
clean mode source ↗

bpo-35540 dataclasses.asdict support defaultdict fields by kwsp · Pull Request #32056 · python/cpython

dataclasses.asdict breaks when there are `defaultdict`s in the dataclass
attributes because it assumes `defaultdict` and `dict` are the same thing,
but in reality `defaultdict` takes a default_factory as the first argument
in its constructor. This change adds support for defaultdict fields.

@kwsp

@wrmsr wrmsr mannequin mentioned this pull request

Apr 10, 2022

MaxwellDupre

@ericvsmith

ericvsmith

@kwsp

carljm added a commit to carljm/cpython that referenced this pull request

Oct 8, 2022

This was referenced

Oct 10, 2022

This was referenced

Oct 11, 2022

mpage pushed a commit to mpage/cpython that referenced this pull request

Oct 11, 2022

@kwsp kwsp mentioned this pull request

Jun 26, 2023