https://github.com/python/cpython/commit/bad9296fb0424bc480fa0ecfd2d60f73c33358f5
commit: bad9296fb0424bc480fa0ecfd2d60f73c33358f5
branch: main
author: sobolevn <[email protected]>
committer: sobolevn <[email protected]>
date: 2026-05-05T17:58:49+03:00
summary:

gh-149410: Test that `typing.NoDefault` is final (#149411)

files:
M Lib/test/test_typing.py

diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 5d19e3706802dd..ad644bb3128809 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -11131,6 +11131,10 @@ def test_no_attributes(self):
         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__."""

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to