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 hints #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add type hints #23

wants to merge 1 commit into from

Conversation

scop
Copy link
Contributor

@scop scop commented Dec 24, 2020

This adds type hints to the entire tree. I'm not familiar with poetry, so not quite sure I got the dependencies right: with 3.6+, typing is in stdlib so no need to add a separate dependency; and I added mypy dev dep for 3.6+ only to follow what's being done with bandit, flake8, pylint and tox.

I did not feel like adding a separate config file for mypy config and it doesn't support pyproject.toml yet, so to check, invoke

mypy --config-file tox.ini url_normalize tests

I didn't find a place in the tree where the tool invocations would be specified, so there was no place I could add the above to.

Includes unrelated deconstruct_url docstring typo fix which I'm too lazy to submit separately.

@scop
Copy link
Contributor Author

scop commented Dec 24, 2020

I should also note that a bunch of the hints are actually inaccurate on Python 2 with regards to bytes/str/unicode. I guess it would be possible to improve on that in case someone is interested in it, but I didn't feel like doing more towards that besides making mypy pass and them syntactically valid 2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant