]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149410: Test that `typing.NoDefault` is final (#149411)
authorsobolevn <mail@sobolevn.me>
Tue, 5 May 2026 14:58:49 +0000 (17:58 +0300)
committerGitHub <noreply@github.com>
Tue, 5 May 2026 14:58:49 +0000 (17:58 +0300)
Lib/test/test_typing.py

index 5d19e3706802dd401fe0f12f6e7ad6602d3c3b7f..ad644bb3128809842ae64ec33f69071900bc2a38 100644 (file)
@@ -11131,6 +11131,10 @@ class NoDefaultTests(BaseTestCase):
         with self.assertRaises(AttributeError):
             type(NoDefault).foo
 
+    def test_no_subclassing(self):
+        with self.assertRaises(TypeError):
+            class Test(type(NoDefault)): ...
+
 
 class AllTests(BaseTestCase):
     """Tests for __all__."""