Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b821868 commit 2f0bfd2Copy full SHA for 2f0bfd2
1 file changed
Lib/test/test_typing.py
@@ -1772,6 +1772,11 @@ def test_default_globals(self):
1772
hints = get_type_hints(ns['C'].foo)
1773
self.assertEqual(hints, {'a': ns['C'], 'return': ns['D']})
1774
1775
+ def test_final_forward_ref(self):
1776
+ self.assertEqual(gth(Loop, globals())['attr'], Final[Loop])
1777
+ self.assertNotEqual(gth(Loop, globals())['attr'], Final[int])
1778
+ self.assertNotEqual(gth(Loop, globals())['attr'], Final)
1779
+
1780
1781
class OverloadTests(BaseTestCase):
1782
@@ -1858,6 +1863,9 @@ class CSub(B):
1858
1863
class G(Generic[T]):
1859
1864
lst: ClassVar[List[T]] = []
1860
1865
1866
+class Loop:
1867
+ attr: Final['Loop']
1868
1861
1869
class NoneAndForward:
1862
1870
parent: 'NoneAndForward'
1871
meaning: None
0 commit comments