Python version: 3.13.7
typed_classproperties version: 1.4.0
VSCode Pylance version: 2025.9.1
The return type of a @classproperty method is resolved as a classproperty instead of the return type hint given when accessed in a @classmethod.
Pylance reports: Type "classproperty" is not assignable to return type "int". "classproperty" is not assignable to "int" for the following sample code in method:
from typed_classproperties import classproperty
class MyClass:
@classproperty
def CLASSPROP(cls) -> int:
return 1
@classmethod
def method(cls) -> int:
return cls.CLASSPROP
When used in a non-classmethod context, the type is resolved correctly.
Python version: 3.13.7
typed_classproperties version: 1.4.0
VSCode Pylance version: 2025.9.1
The return type of a
@classpropertymethod is resolved as aclasspropertyinstead of the return type hint given when accessed in a@classmethod.Pylance reports:
Type "classproperty" is not assignable to return type "int". "classproperty" is not assignable to "int"for the following sample code inmethod:When used in a non-
classmethodcontext, the type is resolved correctly.