Commit 7567680
committed
bpo-35540: Fix dataclasses.asdict support for defaultdict fields
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.1 parent 9b889b5 commit 7567680
File tree
2 files changed
+9
-0
lines changed- Lib
- Misc/NEWS.d/next/Library
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1298 | 1306 | | |
1299 | 1307 | | |
1300 | 1308 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments