-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.sparse
Milestone
Description
Describe your issue.
In SciPy 1.15, matrix multiplication of a coo_matrix with an invalid type value does not raise a TypeError. This is a minor bug that will not cause major confusion, but it is likely not the intended behavior.
Reproducing Code Example
In SciPy 1.15.1,
>>> import scipy
>>> x = scipy.sparse.coo_matrix((3, 4))
>>> x.dot(None)
NotImplemented
In SciPy 1.14.1 (Expected),
>>> import scipy
>>> x = scipy.sparse.coo_matrix((3, 4))
>>> x.dot(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../.pyenv/versions/3.11.11/lib/python3.11/site-packages/scipy/sparse/_base.py", line 450, in dot
return self @ other
~~~~~^~~~~~~
TypeError: unsupported operand type(s) for @: 'coo_matrix' and 'NoneType'
SciPy/NumPy/Python version and system information
OS : Linux-5.4.0-193-generic-x86_64-with-glibc2.31
Python Version : 3.11.11
NumPy Version : 2.2.1
SciPy Version : 1.15.1
kmaehashi
Metadata
Metadata
Assignees
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.sparse