-
Notifications
You must be signed in to change notification settings - Fork 244
Refactor: use Literal in type hints #1670
Copy link
Copy link
Open
Labels
area/typinggood-first-issueSuitable as your first contribution to DocArray!Suitable as your first contribution to DocArray!
Metadata
Metadata
Assignees
Labels
area/typinggood-first-issueSuitable as your first contribution to DocArray!Suitable as your first contribution to DocArray!
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
In progress by community
Right now we don't really use
Literaltypes anywhere, but we should.For example, see the following signature:
Here,
protocolcan 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).