Skip to content

Type checking for property.{fget,fset,fdel} #1112

@jpy-git

Description

@jpy-git

When trying to fix an issue in typeshed we found that both mypy and pyright raised incorrect errors that were also inconsistent with one another so I'm creating this issue to facilitate further discussion on resolving this.

class A:
    @property
    def foo(self):
        return 'a'

A.foo.fget(A())

mypy: "Callable[[A], Any]" has no attribute "fget"
pyright: Expected 0 positional arguments

Initial PR attempt and relevant discussions can be found here

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: otherOther topics not covered

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions