Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add typing to examples. #2435

Merged
merged 10 commits into from
Nov 4, 2024
Merged

Add typing to examples. #2435

merged 10 commits into from
Nov 4, 2024

Conversation

janiversen
Copy link
Collaborator

Add test example for write_registers, to ensure the different lists are legal.

@janiversen
Copy link
Collaborator Author

janiversen commented Nov 4, 2024

@MAKOMO I had to change the write_registers typing, to make it consistent with the internals, but to ensure it worked I added a test case in client_async_calls.py: async_write_registers_mypy just to check that mypy did not throw it out.

@janiversen janiversen merged commit 2d6e9eb into dev Nov 4, 2024
1 check passed
@janiversen janiversen deleted the mypy branch November 4, 2024 16:47
@MAKOMO
Copy link
Contributor

MAKOMO commented Nov 4, 2024

@MAKOMO I had to change the write_registers typing, to make it consistent with the internals, but to ensure it worked I added a test case in client_async_calls.py: async_write_registers_mypy just to check that mypy did not throw it out.

Looks good to me! Thanks for those tests. They will be helpful in the future.

@janiversen
Copy link
Collaborator Author

If you want other typing tests, then please just add them to client_async_call.py, maybe rename write_registers_mypy to something like check_mypy.

The disadvantage for you is a bit work upfront, but the bigger advantage is that the typing is checked in every PR.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants