Skip to content

Commit 719f6d9

Browse files
typing: Cast transpose to ArrayLike
Sonnet 4's summary: > The mypy error occurred because the transpose() method on line 659 was > returning a value that mypy inferred as Any, while the function signature > declared it should return ArrayLike. Mypy's no-any-return rule flags when > you return an Any value from a function with a specific return type annotation.
1 parent 0e55857 commit 719f6d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pyhf/tensor/numpy_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,4 +656,4 @@ def transpose(self, tensor_in: Tensor[T]) -> ArrayLike:
656656
657657
.. versionadded:: 0.7.0
658658
"""
659-
return tensor_in.transpose()
659+
return cast(ArrayLike, tensor_in.transpose())

0 commit comments

Comments
 (0)