-
Notifications
You must be signed in to change notification settings - Fork 19
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
Cleanup @property stuff on BaseRemoteEndpoint #136
Cleanup @property stuff on BaseRemoteEndpoint #136
Conversation
def is_running(self) -> bool: | ||
return not self.is_stopped and self.running.is_set() | ||
return not self.is_stopped and self._running.is_set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really confused by this. How is it possible that neither mypy
nor flake8
caught this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my local env. just pushed something to see if CI catches it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems it catches it after this change but not on current master which is really weird. Also, the @property
decorators also need to be applied on the RemoteEndpointAPI
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, as soon as you remove the @property
from is_stopped
it won't catch this error anymore. This feels like a weird mypy bug to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, here is a minimal test case.
class TestCase:
def foo(self) -> bool:
return False and self.meh()
This is not caught by mypy
. Do you think this is expected behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened an issue against mypy python/mypy#6990
cd08697
to
42ec907
Compare
What was wrong?
There were some errors in the implementation that needed cleaning up
How was it fixed?
Fixed them (need to add tests)
Cute Animal Picture