Skip to content

Property, classmethod and staticmethod aliases not supported #6700

Open
@serhiy-storchaka

Description

@serhiy-storchaka

MyPy does not support property aliases. Example:

$ cat a.py 
class A:
    @property
    def f(self) -> int:
        return 1
    g = f

x: int = A().f
y: int = A().g
$ mypy a.py 
a.py:8: error: Incompatible types in assignment (expression has type "Callable[[], int]", variable has type "int")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongfalse-positivemypy gave an error on correct codepriority-0-hightopic-descriptorsProperties, class vs. instance attributes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions