diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_typing.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 088db9c..46b7621 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1772,6 +1772,11 @@ class ForwardRefTests(BaseTestCase): hints = get_type_hints(ns['C'].foo) self.assertEqual(hints, {'a': ns['C'], 'return': ns['D']}) + def test_final_forward_ref(self): + self.assertEqual(gth(Loop, globals())['attr'], Final[Loop]) + self.assertNotEqual(gth(Loop, globals())['attr'], Final[int]) + self.assertNotEqual(gth(Loop, globals())['attr'], Final) + class OverloadTests(BaseTestCase): @@ -1858,6 +1863,9 @@ class CSub(B): class G(Generic[T]): lst: ClassVar[List[T]] = [] +class Loop: + attr: Final['Loop'] + class NoneAndForward: parent: 'NoneAndForward' meaning: None |