We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This was reported by @srittau in #220 (comment):
It also seems that the getter and setter need to have the same type at the moment:
class Foo: @property def bar(self) -> str: ... @bar.setter def bar(self, v: int) -> None: ... Foo().bar = 3
This will cause mypy 0.550 to complain:
foo.py:7: error: Incompatible types in assignment (expression has type "int", variable has type "str")
While this example is a bit silly, I have a real-world example involving setting arbitrary Mappings and getting a custom Mapping subtype.
The text was updated successfully, but these errors were encountered:
Closing as duplicate of #3004 that has more discussion and typical use cases (non-optional getters and container normalization).
Sorry, something went wrong.
No branches or pull requests
This was reported by @srittau in #220 (comment):
It also seems that the getter and setter need to have the same type at the moment:
This will cause mypy 0.550 to complain:
While this example is a bit silly, I have a real-world example involving setting arbitrary Mappings and getting a custom Mapping subtype.
The text was updated successfully, but these errors were encountered: