Skip to content

Commit

Permalink
[3.12] gh-107909: Test explicit object base in PEP695 generic class…
Browse files Browse the repository at this point in the history
…es (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 <mail@sobolevn.me>
  • Loading branch information
miss-islington and sobolevn committed Aug 17, 2023
1 parent 560e859 commit 2166a40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/test_type_params.py
Expand Up @@ -148,6 +148,10 @@ def test_disallowed_expressions(self):
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):
Expand Down

0 comments on commit 2166a40

Please sign in to comment.