Skip to content

@classproperty return type is not correctly resolved when used in a @classmethod #106

Description

@HS-RAM

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingunsupported-type-checkerOnly relating to a type-checker implementation that is not officially supported

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions