You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
foo.py:9: error: "Callable[[Any], Any]" has no attribute "setter"
I think this is related to #1465 but slightly different. Here my getter and setter are next to each other, but the function name is different. I'm not saying that having different function names is good practice (I meant for them to be the same, but I had a typo), but technically it is valid code and shouldn't produce an error:
What's technically valid and what mypy should allow are two different things. So if this is bad style I like that mypy caught it. If you really want your code like that all you have to do is add # type: ignore to the line with the error.
The following code produces a confusing error:
Error:
I think this is related to #1465 but slightly different. Here my getter and setter are next to each other, but the function name is different. I'm not saying that having different function names is good practice (I meant for them to be the same, but I had a typo), but technically it is valid code and shouldn't produce an error:
I like the fact that mypy accidentally caught this typo, but I don't think it should have.
The text was updated successfully, but these errors were encountered: