Skip to content

no error when getter and setter types don't match in property.__init__ #13127

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

Open
DetachHead opened this issue Jul 15, 2022 · 2 comments
Open
Labels
feature topic-descriptors Properties, class vs. instance attributes

Comments

@DetachHead
Copy link
Contributor

class A:
    def _get_foo(self) -> int:
        ...
    def _set_foo(self, value: str) -> None:
        ...
    foo = property(fget=_get_foo, fset=_set_foo)

playground

@DetachHead DetachHead added the bug mypy got something wrong label Jul 15, 2022
@AlexWaygood AlexWaygood added topic-descriptors Properties, class vs. instance attributes feature and removed bug mypy got something wrong labels Jul 15, 2022
@ydirson
Copy link

ydirson commented May 12, 2023

This is dup of #12892, close it?

@DetachHead
Copy link
Contributor Author

I think it's slightly different because the error correctly occurs when doing the same thing with the @property decorator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-descriptors Properties, class vs. instance attributes
Projects
None yet
Development

No branches or pull requests

3 participants