Skip to content

False negative with property and decorator #16857

Open
@hauntsaninja

Description

@hauntsaninja

Relates to #5858 (fixed in #15926)

from typing import Callable

class something_callable:
    def __init__(self, fn):
        self.fn = fn
    def __call__(self, decorated_self, extra1, extra2, extra3) -> str:
        return self.fn(decorated_self)
    # def __call__(self) is also bad

def decorator(fn: Callable[..., int]) -> something_callable:
    return something_callable(fn)

class A:
    @property
    @decorator
    def f(self) -> int:
        return 42

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions