-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add type hints to sydent/http/servlets #361
Conversation
Signed-off-by: H.Shay <shaysquared@gmail.com>
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.
I left one comment which is applicable to the entire PR, besides that I think this seems pretty good though!
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.
I think the main key here is that we should attempt to be a bit more consistent, some of the render_FOO
functions return dict
, sometimes Dict
, sometimes Dict[str, Any]
(or even more specific types).
It might help to define a JsonDict = Dict[str, Any]
and then import that and return it as we do in Synapse.
…into add_mypy_servlets
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.
Almost there! Just a few minor changes!
Have we been removing the |
I haven't been removing the |
That sounds like a good plan. (The reasoning to remove them is that there's no reason to encode the same info in two places, especially if one is enforced by a tool -- like mypy -- it tends to get out of date quickly.) |
This PR request adds type hints to sydent/http/servlets. There were very few docstrings/comments so I did my best to figure out what the types were and add them.