-
Notifications
You must be signed in to change notification settings - Fork 53
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
added more type hints #111
base: main
Are you sure you want to change the base?
Conversation
dc34c58
to
be97721
Compare
@vasdee thanks! This is awesome. Looking through it might take some time. Can you have a look at the a filing CI pipeline? |
Please run You don't have to get the errors down to zero to get this MR into a merge-able territory - just check the mypy output for potential wrong annotations. |
This is about all the type hinting that I can add, and I can't fix all the mypy errors until work is done to remove the excessive use of I think this is a good thing, it highlights that cleanup work can be done to make it cleaner :) |
d8b1144
to
7d805bf
Compare
* added __future__ annotations for < 3.10 compatibility * added as much type hints as possible * added more type hinting for __slots__ * added typed dict for Subscription and Unsubscription possibly only a python3.8 feature
fb07daf
to
568b1a7
Compare
Any progress on getting this merged? I feel it is at a pretty good state and has given me some clean up ideas to further reduce the mypy errors. |
looks like there is some failing tests, which I haven't figured out why they would be failing with type hint additions. This doesn't happen on Master so i'm not sure what is going on.. FAILED tests/test_broker.py::test_client_publish_acl_permitted - asyncio.exceptions.TimeoutError |
I'm interested in contributing to this project, I was very glad to see that hbmqtt was getting some much needed love :)
I used this opportunity to get familiar with the internals of the code base, but at the same time I found it useful to add more and more type hints as I was exploring. I'm sure there will be some mistakes here and there, some of them were definitely "best guesses".
Just within these added hints alone, it has already high lighted some areas that could already be tightened up, so I think it is definitely worth the effort for adding as much hinting as possible