Commit dd25f94
committed
stubtest: don't flag __class_getitem__ missing for PEP 695 generic stubs
PEP 695 generic syntax (class Foo[T]: ...) implicitly provides
__class_getitem__ at runtime. When a stub uses this syntax and the
runtime class defines __class_getitem__ explicitly, stubtest was
incorrectly reporting it as missing from the stub.
Fix: in verify_typeinfo(), discard "__class_getitem__" from the set of
attributes to check when the stub class has PEP 695 type parameters
(ClassDef.type_args is not None).
Fixes: #212531 parent dee7b3d commit dd25f94
2 files changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
703 | 707 | | |
704 | 708 | | |
705 | 709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
1828 | 1841 | | |
1829 | 1842 | | |
1830 | 1843 | | |
| |||
0 commit comments