summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-08-16 13:30:03 (GMT)
committerGitHub <noreply@github.com>2023-08-16 13:30:03 (GMT)
commitb61f5995aebb93496e968ca8d307375fa86d9329 (patch)
treed2eda7c1f417457f24c88166d21189663ea79953
parenta8d440b3837273926af5ce996162b019290ddad5 (diff)
downloadcpython-b61f5995aebb93496e968ca8d307375fa86d9329.zip
cpython-b61f5995aebb93496e968ca8d307375fa86d9329.tar.gz
cpython-b61f5995aebb93496e968ca8d307375fa86d9329.tar.bz2
gh-107909: Test explicit `object` base in PEP695 generic classes (#108001)
-rw-r--r--Lib/test/test_type_params.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_type_params.py b/Lib/test/test_type_params.py
index bced641..0045057 100644
--- a/Lib/test/test_type_params.py
+++ b/Lib/test/test_type_params.py
@@ -148,6 +148,10 @@ class TypeParamsInvalidTest(unittest.TestCase):
check_syntax_error(self, "def f[T: [(x := 3) for _ in range(2)]](): pass")
check_syntax_error(self, "type T = [(x := 3) for _ in range(2)]")
+ def test_incorrect_mro_explicit_object(self):
+ with self.assertRaisesRegex(TypeError, r"\(MRO\) for bases object, Generic"):
+ class My[X](object): ...
+
class TypeParamsNonlocalTest(unittest.TestCase):
def test_nonlocal_disallowed_01(self):