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 for all definitions #89

Closed
Cito opened this issue May 4, 2020 · 3 comments
Closed

Add type annotations for all definitions #89

Cito opened this issue May 4, 2020 · 3 comments

Comments

@Cito
Copy link
Member

Cito commented May 4, 2020

We should add type annotations for all definitions except those in tests, and enforce this with a mypy.ini configuration like this:

[mypy]
python_version = 3.8
...
disallow_untyped_defs = True

[mypy-tests.*]
disallow_untyped_defs = False
@KingDarBoja
Copy link

Could you provide an example regarding type annotations for definitions that are missing? Cheers!

@Cito
Copy link
Member Author

Cito commented Jul 1, 2020

@KingDarBoja When you set disallow_untyped_defs = True, mypy will list all the missing definitions, like missing return type of a __str__ method, and missing type annotations for internal functions.

Cito added a commit that referenced this issue Jul 1, 2020
@Cito
Copy link
Member Author

Cito commented Jul 1, 2020

I have now added all the missing definitions, except for a few modules where it makes no sense or where I'm waiting for #99.

@Cito Cito closed this as completed Jul 1, 2020
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

No branches or pull requests

2 participants