Skip to content

Decorated properties report error: "not callable" in mypy 1.7.1 and master #16694

Open
@rouge8

Description

@rouge8

Bug Report

Prior to mypy 1.7, we were able to add decorators on top of properties by adding a # type: ignore comment. In 1.7.1, the decorated attribute now errors on access with not callable [operator].

To Reproduce

https://mypy-play.net/?mypy=1.7.1&python=3.11&gist=12b3add6be6394238695b9b42c79d425

Expected Behavior

No errors.
Actual Behavior

main.py:20: error: "MyObj" not callable  [operator]
Found 1 error in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 1.7.1, master
  • Python version used: 3.11

Activity

rouge8

rouge8 commented on Feb 5, 2024

@rouge8
Author

This was broken by #15926 cc @hauntsaninja

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

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

        Participants

        @rouge8

        Issue actions

          Decorated properties report error: "not callable" in mypy 1.7.1 and master · Issue #16694 · python/mypy