diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-08-17 10:53:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 10:53:59 (GMT) |
commit | 2166a407b29d7dc944e6d9159a4f6b8ffb6dc5e6 (patch) | |
tree | 1ce0c9e3d37bf0f1129102590d3da27414d1b858 | |
parent | 560e8595cb34b995310157c6e7a0ca2ecf559885 (diff) | |
download | cpython-2166a407b29d7dc944e6d9159a4f6b8ffb6dc5e6.zip cpython-2166a407b29d7dc944e6d9159a4f6b8ffb6dc5e6.tar.gz cpython-2166a407b29d7dc944e6d9159a4f6b8ffb6dc5e6.tar.bz2 |
[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 b61f5995aebb93496e968ca8d307375fa86d9329)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
-rw-r--r-- | Lib/test/test_type_params.py | 4 |
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): |