Commit 1af7b2c
authored
Check superclass compatibility of untyped methods if
This PR enables superclass compatibility checks for untyped methods when
`--check-untyped-defs` is set. IMO this behavior is correct as
`--check-untyped-defs` is essentially "treat everything as if there were
`: Any` annotations on all arguments", hence checking arg count and
names is sound.
This PR, however, allows `@override` on classes that have Any fallback
as those are often coming from unfollowed imports. This PR started as an
attempt to reject `@override` on untyped defs not found in superclass,
but I think it's better to just run all compatibility checks if the flag
is enabled.--check-untyped-defs is set (#18970)1 parent 25b1bb8 commit 1af7b2c
File tree
3 files changed
+85
-2
lines changed- mypy
- test-data/unit
3 files changed
+85
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
753 | 756 | | |
754 | 757 | | |
755 | 758 | | |
| |||
5285 | 5288 | | |
5286 | 5289 | | |
5287 | 5290 | | |
5288 | | - | |
| 5291 | + | |
5289 | 5292 | | |
5290 | 5293 | | |
5291 | 5294 | | |
5292 | 5295 | | |
5293 | 5296 | | |
| 5297 | + | |
| 5298 | + | |
| 5299 | + | |
5294 | 5300 | | |
5295 | 5301 | | |
5296 | 5302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6651 | 6651 | | |
6652 | 6652 | | |
6653 | 6653 | | |
6654 | | - | |
| 6654 | + | |
| 6655 | + | |
| 6656 | + | |
| 6657 | + | |
| 6658 | + | |
| 6659 | + | |
| 6660 | + | |
| 6661 | + | |
| 6662 | + | |
| 6663 | + | |
| 6664 | + | |
| 6665 | + | |
| 6666 | + | |
| 6667 | + | |
| 6668 | + | |
| 6669 | + | |
| 6670 | + | |
| 6671 | + | |
| 6672 | + | |
| 6673 | + | |
| 6674 | + | |
| 6675 | + | |
| 6676 | + | |
| 6677 | + | |
| 6678 | + | |
| 6679 | + | |
| 6680 | + | |
| 6681 | + | |
| 6682 | + | |
| 6683 | + | |
| 6684 | + | |
| 6685 | + | |
| 6686 | + | |
| 6687 | + | |
| 6688 | + | |
| 6689 | + | |
| 6690 | + | |
| 6691 | + | |
| 6692 | + | |
| 6693 | + | |
| 6694 | + | |
| 6695 | + | |
| 6696 | + | |
| 6697 | + | |
| 6698 | + | |
6655 | 6699 | | |
6656 | 6700 | | |
6657 | 6701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3285 | 3285 | | |
3286 | 3286 | | |
3287 | 3287 | | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
3288 | 3321 | | |
3289 | 3322 | | |
3290 | 3323 | | |
| |||
0 commit comments