8000 gh-107909: Test explicit `object` base in PEP695 generic classes (#10… · python/cpython@b61f599 · GitHub
[go: up one dir, main page]

Skip to content

Commit b61f599

Browse files
authored
gh-107909: Test explicit object base in PEP695 generic classes (#108001)
1 parent a8d440b commit b61f599

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)
0