-
Notifications
You must be signed in to change notification settings - Fork 162
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 static typing to labeler utils #668
Add static typing to labeler utils #668
Conversation
|
||
if y_type.startswith("multilabel"): | ||
average_options = ("micro", "macro", "weighted", "samples") | ||
average_options: Tuple[str, ...] = ("micro", "macro", "weighted", "samples") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the ...
do we not want to enforce a len of four? so something like Tuple[str, str, str, str]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next line is a tuple with length 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To specify a variable-length tuple of homogeneous type, use literal ellipsis, e.g. Tuple[int, ...]. A plain [Tuple](https://docs.python.org/3/library/typing.html#typing.Tuple) is equivalent to Tuple[Any, ...], and in turn to [tuple](https://docs.python.org/3/library/stdtypes.html#tuple).
Head branch was pushed to by a user without write access
#609