There are a lot of test cases in test_typing.py where we test that different typing things cannot be used as base classes. However, there are multiple missing cases. Examples:
Final / Final[int] is not tested to be invalid base class:
|
def test_cannot_subclass(self): |
|
with self.assertRaisesRegex(TypeError, CANNOT_SUBCLASS_TYPE): |
|
class C(type(Final)): |
|
pass |
|
with self.assertRaisesRegex(TypeError, CANNOT_SUBCLASS_TYPE): |
|
class C(type(Final[int])): |
|
pass |
|
|
|
def test_cannot_init(self): |
Ts is tested, but *Ts is not:
- Different special forms only tested with / or without
[]
- And other issues
I think this should be all covered. I went through all subtyping tests and added more cases.
I will send a PR :)
There are a lot of test cases in
test_typing.pywhere we test that different typing things cannot be used as base classes. However, there are multiple missing cases. Examples:Final/Final[int]is not tested to be invalid base class:cpython/Lib/test/test_typing.py
Lines 3748 to 3756 in 53a54b7
Tsis tested, but*Tsis not:cpython/Lib/test/test_typing.py
Line 1039 in 53a54b7
[]I think this should be all covered. I went through all subtyping tests and added more cases.
I will send a PR :)