Skip to content

Commit 6a71ef3

Browse files
committed
Fixes integer check
1 parent 004f2fa commit 6a71ef3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

matrix/matrix_operation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def inverse(matrix):
111111

112112

113113
def _check_not_integer(matrix):
114-
return not isinstance(matrix, int) and not isinstance(matrix[0], int)
114+
if not isinstance(matrix, int) and not isinstance(matrix[0], int):
115+
return True
116+
raise TypeError("Expected a matrix, got int/list instead")
117+
115118

116119
def _shape(matrix):
117120
return list((len(matrix), len(matrix[0])))

0 commit comments

Comments
 (0)