Commit b147d11
authored
Move dataclass kw_only fields to the end of the signature (#19018)
Fixes #19017. Fixes #17731.
This is a rather naive change: python does that at runtime. `kw_only`
args can be in any order, and non-kwonly args should remain sorted as-is
(stable sort). I don't understand why this was only done in presence of
a parent dataclass - AFAIC kwonly fields work that way since `kw_only`
was introduced in py3.10.
The test I changed was invalid and asserted a false positive to the best
of my knowledge.1 parent 9ded5b1 commit b147d11
File tree
3 files changed
+37
-11
lines changed- mypy/plugins
- test-data/unit
3 files changed
+37
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
550 | 549 | | |
551 | 550 | | |
552 | 551 | | |
| |||
556 | 555 | | |
557 | 556 | | |
558 | 557 | | |
559 | | - | |
560 | 558 | | |
561 | 559 | | |
562 | 560 | | |
| |||
720 | 718 | | |
721 | 719 | | |
722 | 720 | | |
723 | | - | |
724 | | - | |
| 721 | + | |
725 | 722 | | |
726 | 723 | | |
727 | 724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
| 463 | + | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
471 | 473 | | |
472 | 474 | | |
473 | 475 | | |
| |||
2618 | 2620 | | |
2619 | 2621 | | |
2620 | 2622 | | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
0 commit comments