void () { runWithLanguageLevel( LanguageLevel.PYTHON36, () -> doTestByText( """ from typing_extensions import Final class A: a: Final[int] = 1 b: Final[str] = "1" <warning descr="Either instance attribute or class attribute could be type hinted as 'Final'">c</warning>: Final[int] def __init__(self): <warning descr="Already declared name could not be redefined as 'Final'">self.a</warning>: Final[int] = 2 self.b = "2" <warning descr="Either instance attribute or class attribute could be type hinted as 'Final'">self.c</warning>: Final[int] = 2""") ); }