-
Notifications
You must be signed in to change notification settings - Fork 148
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
Type hints for apnstruncate, apnspushkin, notifications, and gcmpushkin #264
Conversation
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.
Thanks for tackling this!
I think you might be noticing that trying to bite a lot at once will pull you into everywhere else in the code because everything's linked together.
A couple of places where you've used cast
I've tried to replace with actual checks — cast
should be thought of as 'oi mypy, you're too stupid to see that I'm right so just trust me unconditionally' — in general, we try to avoid it.
For the |
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 are merge conflicts, otherwise very close to merge I think
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.
lgtm otherwise
…form to function signature
Co-authored-by: reivilibre <oliverw@matrix.org>
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.
Thank you!
Here is my first try at adding some type hints to the below files in Sygnal, and making very minor modifications to the code to silence some mypy errors (like
assert is not None
).A very small handful of errors remain (less than 4 I think?) across the files I changed but silencing them seemed like it might require more modification to the code, and I wanted to make sure that everything I had here was correct before I started tackling those.
I think that these are mostly correct but I find typing to be a little difficult so it is entirely possible I have gotten some things wrong.