Skip to content
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

Annotate wptserve's logger.py + utils.py #28815

Closed
wants to merge 1 commit into from

Conversation

@foolip
Copy link
Member

@foolip foolip commented May 4, 2021

No description provided.

@foolip
Copy link
Member Author

@foolip foolip commented May 4, 2021

@gsnedders I'm having some fun learning more about mypy. I'm not sure it's worth annotating all of wptserve, but the reason I started was because I found it very hard to guess what the types of some arguments in request.py were. But starting from the "leaf" files results in less cascading errors.

Is there an approach to incrementally improving type coverage that you took for other bits that I could copy?

@gsnedders
Copy link
Contributor

@gsnedders gsnedders commented May 7, 2021

@gsnedders I'm having some fun learning more about mypy. I'm not sure it's worth annotating all of wptserve, but the reason I started was because I found it very hard to guess what the types of some arguments in request.py were. But starting from the "leaf" files results in less cascading errors.

Is there an approach to incrementally improving type coverage that you took for other bits that I could copy?

By and large I used pyannotate (though we probably want monkeytypes at this point) to generate type annotations based on what we're actually using, then started editing them till mypy was happy.

@foolip
Copy link
Member Author

@foolip foolip commented May 7, 2021

@gsnedders thanks, I saw tools like that mentioned in mypy docs, should maybe give that a try then.

@foolip foolip closed this May 13, 2021
@foolip foolip deleted the foolip/typing-wptserve-logger-utils branch May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants