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

Eliminate type-ignore that's generated for enums (allowing us to eliminate warn_unused_ignores = False in mypy.ini) #239

Closed
nipunn1313 opened this issue Jul 9, 2021 · 2 comments · Fixed by #260

Comments

@nipunn1313
Copy link
Owner

Per discussion in #214 - see if we can eliminate the type-ignore that's generated for enums

It exists to sidestep the circular dependency that our enum strategy creates. In order to use the alternate strategy of pulling the type definition up one level, we need type aliases to work within a class - see python/mypy#10788

@pcorpet
Copy link
Contributor

pcorpet commented Jul 17, 2021

mypy seems to manage the type properly and thus is raising a

error: unused "type: ignore" comment

Do you know a way for comments to only be used by pyright? or do you recommend to disable the warnings in mypy? (--no-warn-unused-ignores) although that would mean to remove it for all other warnings :-(

@nipunn1313
Copy link
Owner Author

nipunn1313 commented Jul 19, 2021

The technique I used was to update mypy.ini via the same technique as in #237

[mypy-testproto.*]
warn_unused_ignores = False

It may be an unsatisfying method - hence this task here to help resolve permanently via some other means. #241 is likely a prereq to solving this.

@nipunn1313 nipunn1313 changed the title Eliminate type-ignore that's generated for enums Eliminate type-ignore that's generated for enums (allowing us to eliminate warn_unused_ignores = False in mypy.ini) Jul 19, 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
Development

Successfully merging a pull request may close this issue.

2 participants