Conversation
varlink/client.py
Outdated
| raise NotImplementedError | ||
|
|
||
| def _next_message(self): | ||
| def _next_message(self) -> None: |
There was a problem hiding this comment.
I don't think this can be typed like this, because line 81 calls next(self._next_message()) and treats the returned value as a JSON-string.
This doesn't make an awful lot of sense, since the only implementation of _next_message actually doesn't return anything. I think there might be a bug somewhere.
There was a problem hiding this comment.
This is the abstract class and I am not sure what the best way is to handle typing this when it wouldn't return a valid type. So that will need some further investigation.
In another test it is set to 0.1 which upsets mypy as it changes the type from a float to an int.
| self.name = name | ||
| self.identifier = str(uuid.uuid4()) | ||
| self.interface_description = None | ||
| self.interface_description: list[str] = [] |
There was a problem hiding this comment.
This change might break people assuming that an uninitalised interface_description is None and after interface_description is initalised, it is a list with at least one element. This seems a bit silly, since an empty list is a perfectly fine boolean to encode this, so it doesn't need to be None, but I wonder if there is any usage of that out in the wild. The only thing I find for interface_description is None on GitHub is not varlink, so changing this is most likely safe.
No description provided.