void () { runWithLanguageLevel( LanguageLevel.PYTHON36, () -> doTestByText(""" from typing_extensions import Final class A: a: Final[int] = 1 def __init__(self): self.a = 2 self.a += 2 def method(self): self.a = 3 self.a += 3 @classmethod def cls_method(cls): <warning descr="'a' is 'Final' and could not be reassigned">cls.a</warning> = 5 <warning descr="'a' is 'Final' and could not be reassigned">cls.a</warning> += 5 <warning descr="'a' is 'Final' and could not be reassigned">A.a</warning> = 4 <warning descr="'a' is 'Final' and could not be reassigned">A.a</warning> += 4 class B(A): @classmethod def my_cls_method(cls): <warning descr="'a' is 'Final' and could not be reassigned">cls.a</warning> = 6 <warning descr="'a' is 'Final' and could not be reassigned">cls.a</warning> += 6 <warning descr="'a' is 'Final' and could not be reassigned">B.a</warning> = 7 <warning descr="'a' is 'Final' and could not be reassigned">B.a</warning> += 7 class C(A): <warning descr="'A.a' is 'Final' and could not be reassigned">a</warning> = 8 """) ); }