Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding method with a property results in a false negative #7565

Closed
ilevkivskyi opened this issue Sep 26, 2019 · 1 comment · Fixed by #13503
Closed

Overriding method with a property results in a false negative #7565

ilevkivskyi opened this issue Sep 26, 2019 · 1 comment · Fixed by #13503
Labels
bug mypy got something wrong priority-1-normal topic-descriptors Properties, class vs. instance attributes

Comments

@ilevkivskyi
Copy link
Member

This tests spuriously passes:

[case testOverrideProperty]
class B:
    def foo(self) -> int:
        ...
class C:
    @property
    def foo(self) -> int:
        ...
[builtins fixtures/property.pyi]

The best long-term approach to fixing this is likely the same as #6759 (comment)

@ilevkivskyi
Copy link
Member Author

Note that the "reverse" override causes a false negative as well, see the example in #8386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong priority-1-normal topic-descriptors Properties, class vs. instance attributes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants