Skip to content

Conversation

janiversen
Copy link
Collaborator

No description provided.

@janiversen
Copy link
Collaborator Author

@alexrudd2 this should solve the mypy problem with mixin.py

@janiversen janiversen merged commit 64a4f7b into dev Feb 20, 2023
@janiversen janiversen deleted the mixin branch February 20, 2023 16:08
@alexrudd2
Copy link
Collaborator

@alexrudd2 this should solve the mypy problem with mixin.py

Yes, it solves the problem with execute(). Thanks!

I believe it should now be possible to solve the others, which are all similar. mypy does not know that ReadCoilsResponse is a subclass of ModbusResponse. Probably it should be e.g. Type[ModbusResponse] which is a type, instead of ModbusResponse, an an instance of a class. I will try to do something like this.
pymodbus/client/mixin.py:69: error: Incompatible return value type (got "ModbusResponse", expected "ReadCoilsResponse") [return-value]

@janiversen
Copy link
Collaborator Author

Sounds correct, but to be honest for me mypy is "try and fail" 👎 but it is nice once it is done.

I will not be touching mixin.py for a while.

alexrudd2 pushed a commit to alexrudd2/pymodbus that referenced this pull request Feb 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants