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

Add type annotations everywhere, help needed #3293

Closed
asvetlov opened this issue Sep 26, 2018 · 8 comments
Closed

Add type annotations everywhere, help needed #3293

asvetlov opened this issue Sep 26, 2018 · 8 comments

Comments

@asvetlov
Copy link
Member

I'm working on adding type hints.
The hints are useless until their correctness is checked by mypy in strong mode.

The problem is: enabling the mode for the whole codebase generates too many errors.
Basically, it is the all-or-nothing situation.

The plan is: let's convert file by file.
To enable strong mode please uncomment mypy options from the settings file: https://github.com/aio-libs/aiohttp/blob/master/setup.cfg#L42-L48
Before submitting a Pull Request please make sure that uncommented config is not landed (revert settings back).

The job is trivial but requires updating too many source code lines, that's why I need a help from the community. Even small PRs are valuable.

@aio-libs-bot
Copy link

GitMate.io thinks possibly related issues are #3230 (iter_chunks type annotation wrong), #1181 (Provide MacOSX binary wheels. Help needed!), #3240 (Missing type annotations in pyi files), #2041 (File external links, help needed), and #2395 (Convert autodoc for multipart into written docs, help needed).

@aio-libs-bot aio-libs-bot added the documentation Improvements or additions to documentation label Sep 26, 2018
@asvetlov asvetlov removed the documentation Improvements or additions to documentation label Sep 26, 2018
@asvetlov
Copy link
Member Author

Supersedes #1749

@YuvalPruss
Copy link

@asvetlov If I want to contribute to this, which PR should I use?

@asvetlov
Copy link
Member Author

asvetlov commented Oct 1, 2018

aiohttp master branch as usual.
I quite don't understand the question about PR but assume you are asking for code branch to start work from.

@asvetlov
Copy link
Member Author

asvetlov commented Oct 2, 2018

Hint:
For MultiDict, CIMultiDict, Signal and FrozenList classes use forward declarations like "CIMultiDict[str]" or aiohttp.typedefs._CIMultiDict to avoid runtime errors.

@asvetlov
Copy link
Member Author

asvetlov commented Oct 2, 2018

tracing.py looks like an easy file to start.
One file per PR is a pretty good modularity for this meta-issue.

@asvetlov
Copy link
Member Author

Finished

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants