Skip to content

Commit a4b3463

Browse files
committed
fix typing
1 parent 8574c34 commit a4b3463

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pyhf/tensor/numpy_backend.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ def tolist(
210210
self, tensor_in: Tensor[T] | list[T]
211211
) -> int | float | complex | list[T] | list[Any]:
212212
try:
213-
return tensor_in.tolist() # type: ignore[union-attr]
213+
result = tensor_in.tolist() # type: ignore[union-attr]
214+
return cast(int | float | complex | list[T] | list[Any], result)
214215
except AttributeError:
215216
if isinstance(tensor_in, list):
216217
return tensor_in
@@ -657,4 +658,5 @@ def transpose(self, tensor_in: Tensor[T]) -> ArrayLike:
657658
658659
.. versionadded:: 0.7.0
659660
"""
660-
return tensor_in.transpose()
661+
result = tensor_in.transpose()
662+
return cast(ArrayLike, result)

0 commit comments

Comments
 (0)