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 mypy Config File #524

Merged
merged 2 commits into from Apr 8, 2020
Merged

Conversation

tomassosorio
Copy link
Contributor

In order to start using Mypy full potential, we must start fixing the issues that he might throw.
Relates to #477

As a starter I add the following definitions to the config file:

allow_redefinition: True
Allows variables to be redefined with an arbitrary type, as long as the redefinition is in the same block and nesting level as the original definition.
ignore_missing_imports: True
Suppresses error messages about imports that cannot be resolved.

@vincentqb
Copy link
Contributor

For reference, pytorch does not have anything beyond python 2.7 compatibility. We do not want python 2.7 of course.

@tomassosorio
Copy link
Contributor Author

tomassosorio commented Apr 8, 2020

For reference, pytorch does not have anything beyond python 2.7 compatibility. We do not want python 2.7 of course.

@vincentqb I did not understand what you meant by that, mypy currently is not passing at all and a lot of errors occur, this configuration will ignore small details such as a variable being change of its type.
This will allow us to better focus in the errors that occur on torchaudio.

If the decision is to leave mypy default values I will close this PR :)

@vincentqb
Copy link
Contributor

Sorry for the misunderstanding :) My comment was meant as a note to self to reference what pytorch is doing.

Those two change from default seems reasonable to me, and a good start. Thanks for adding this :)

Copy link
Contributor

@vincentqb vincentqb left a comment

Choose a reason for hiding this comment

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

LGTM

@vincentqb vincentqb merged commit 98fe8b4 into pytorch:master Apr 8, 2020
@tomassosorio tomassosorio deleted the addMypyConfig branch April 8, 2020 22:10
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

2 participants