Commit 20a49fa
authored
[mypyc] Fix
Closes mypyc/mypyc#1204, a `mypyc` issue.
The issue likely unblocks `isort` from being compiled with `mypyc`,
which is why I took an interest it. Full disclosure is that I used AI to
write this, it provided this test and code just from the linked issue
but it looks sensible to me. I did not use additional prompting. Like I
said, fix looks sensible: we now call `dataclass_type` for each entry in
the MRO, instead of once.
I am aware the contributing guidelines say new contributors are not
encourage to use LLMs but I hope the size of the PR and my track record
as open source maintainer gives some flexibility here. I'm very aware
that reviewing AI written PRs creates maintainer burden, but I'm
committed to getting this over the finish line. To that end I:
Tested locally with `pytest mypyc/test/test_run.py ` and that looked
okay.
Also tested that without the changes the added test would fail on
`master`.
Also tried to run CI on my local fork
(DanielNoord#1), which succeeded.
Feel free to push changes to the branch or cherry pick this into another
branch. I am not necessarily interested in getting credits for the
fix/PR, I'd just like to continue with my attempt to get `isort`
compiled and for that I need this in a `mypy` release :)default_factory for inherited dataclass (#21785)1 parent d79a9e6 commit 20a49fa
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
764 | 763 | | |
765 | 764 | | |
766 | 765 | | |
| |||
774 | 773 | | |
775 | 774 | | |
776 | 775 | | |
| 776 | + | |
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
780 | | - | |
| 780 | + | |
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
78 | | - | |
| 85 | + | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| |||
125 | 132 | | |
126 | 133 | | |
127 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
| |||
0 commit comments