-
Notifications
You must be signed in to change notification settings - Fork 232
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
Refactor: use Literal
in type hints
#1670
Comments
Hey, @JohannesMessner I would like to work on this issue. |
hey @srini047 , It would be great if you can take up this issue. |
Is |
Opened a PR. I'm in favor of an enum over a |
The PR looks good, helping us with further instances of this problem would be great! |
Yes, it would be nice to make sure there are other instances or if we can close this |
I believe these parameters are candidates for similar treatment:
But there may be more |
They do seem nice candidates sure |
Right now we don't really use
Literal
types anywhere, but we should.For example, see the following signature:
Here,
protocol
can only be'pickle' or 'protobuf'
, soLiteral['pickle', 'protobuf']
would be the most suitable type hint.Changing that will require multiple other changes in order to keep mypy happy, since other code relies on protocol being
str
.This issue is about adjusting the above, and identifying and fixing other similar instances (if they exists).
The text was updated successfully, but these errors were encountered: