Skip to content

Commit 2166a40

Browse files
[3.12] gh-107909: Test explicit object base in PEP695 generic classes (GH-108001) (#108022)
gh-107909: Test explicit `object` base in PEP695 generic classes (GH-108001) (cherry picked from commit b61f599) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 560e859 commit 2166a40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_type_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def test_disallowed_expressions(self):
148148
check_syntax_error(self, "def f[T: [(x := 3) for _ in range(2)]](): pass")
149149
check_syntax_error(self, "type T = [(x := 3) for _ in range(2)]")
150150

151+
def test_incorrect_mro_explicit_object(self):
152+
with self.assertRaisesRegex(TypeError, r"\(MRO\) for bases object, Generic"):
153+
class My[X](object): ...
154+
151155

152156
class TypeParamsNonlocalTest(unittest.TestCase):
153157
def test_nonlocal_disallowed_01(self):

0 commit comments

Comments
 (0)