提交 f2b475db authored 作者: Frederic's avatar Frederic 提交者: Pascal Lamblin

Make _is_sparse work on tuple and list.

上级 69e278e2
...@@ -15,7 +15,7 @@ def _is_sparse(x): ...@@ -15,7 +15,7 @@ def _is_sparse(x):
@return: True iff x is a L{scipy.sparse.spmatrix} (and not a @return: True iff x is a L{scipy.sparse.spmatrix} (and not a
L{numpy.ndarray}) L{numpy.ndarray})
""" """
if not isinstance(x, (scipy.sparse.spmatrix, numpy.ndarray)): if not isinstance(x, (scipy.sparse.spmatrix, numpy.ndarray, tuple, list)):
raise NotImplementedError("this function should only be called on " raise NotImplementedError("this function should only be called on "
"sparse.scipy.sparse.spmatrix or " "sparse.scipy.sparse.spmatrix or "
"numpy.ndarray, not,", x) "numpy.ndarray, not,", x)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论