Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add types to the server code and remove unused parameter #7813

Merged
merged 9 commits into from
Jul 10, 2020

Conversation

clokep
Copy link
Member

@clokep clokep commented Jul 9, 2020

This does two unrelated things, minus them being in the same code:

  • Removes the response_code_message, which is unused.
  • Adds some additional type hints.

@clokep clokep requested a review from a team July 9, 2020 18:03
response_code_message: Optional[str] = None,
pretty_print: bool = False,
canonical_json: bool = True,
) -> NOT_DONE_YET:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this function also returns None below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I ended up removing this since NOT_DONE_YET is a constant, not a type and...mypy somewhat gets confused if you try to put Optional[] around it or anything. I added back some comments too.

synapse/http/server.py Outdated Show resolved Hide resolved
synapse/http/server.py Outdated Show resolved Hide resolved
synapse/http/server.py Outdated Show resolved Hide resolved
@clokep clokep requested a review from anoadragon453 July 10, 2020 13:19
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

synapse/http/server.py Outdated Show resolved Hide resolved
Co-authored-by: Richard van der Hoff <[email protected]>
@clokep clokep removed the request for review from anoadragon453 July 10, 2020 18:02
@clokep clokep dismissed anoadragon453’s stale review July 10, 2020 18:28

Dismissing since richvdh reviewed.

@clokep clokep merged commit d9e47af into develop Jul 10, 2020
@clokep clokep deleted the clokep/server-types branch July 10, 2020 18:28
babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit 'd9e47af61':
  Add types to the server code and remove unused parameter (#7813)
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.

3 participants