Skip to content

no error when setting property defined without decorator to incorrect type #13128

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 · 0 comments
Open
Labels
feature topic-descriptors Properties, class vs. instance attributes

Comments

@DetachHead
Copy link
Contributor

DetachHead commented Jul 15, 2022

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

a = A()

a.foo = "" # no error

playground
related: #13127

@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
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

2 participants