ty: un-ignore invalid-type-arguments - #15392
Conversation
|
@priya-sundaram-dev, please review. Are these the best solutions? In In the move to use |
|
Reviewed — the changes are correct, and yes, these are the right solutions. Answers to your three questions: Why does the Do we need all three of Is One tiny nit: |
Removed unused __lt__ method from Comparable protocol and updated docstrings for clarity.
Removed unused import of total_ordering from functools.
Part of #15187.
Fixes the invalid-type-arguments diagnostics and drops the rule from the
ignore list in pyproject.toml.
np.ndarray[float]isn't valid, because the firsttype parameter of ndarray is the shape. Changed to
NDArray[np.float64](and
NDArray[np.int_]for the targets).Heap[int]was rejected because theComparableprotocol'smethods accept keyword arguments, which int's don't. Made the
otherparameters positional-only, as ty suggested.
ty reports no invalid-type-arguments after this, and the doctests for both
files pass. Only annotations changed, nothing at runtime.
Describe your change
Checklist