New issue 2793: cpyext class subclasses lose attributes https://bitbucket.org/pypy/pypy/issues/2793/cpyext-class-subclasses-lose-attributes
pv: On pypy3 (bcbefe2f5e14, 2018-04-05) the following code fails ``` import numpy as np from numpy.testing import assert_allclose x = np.matrix(np.random.rand(12, 12)) for j in range(20000): assert_allclose(x, x) ``` with ``` Traceback (most recent call last): File "<stdin>", line 2, in <module> File ".../env/site-packages/numpy/testing/nose_tools/utils.py", line 1396, in assert_allclose verbose=verbose, header=header, equal_nan=equal_nan) File ".../env/site-packages/numpy/testing/nose_tools/utils.py", line 769, in assert_array_compare reduced = val.ravel() File ".../env/site-packages/numpy/matrixlib/defmatrix.py", line 1020, in ravel return N.ndarray.ravel(self, order=order) File ".../env/site-packages/numpy/matrixlib/defmatrix.py", line 260, in __array_finalize__ if (isinstance(obj, matrix) and obj._getitem): return AttributeError: 'matrix' object has no attribute '_getitem' ``` The `matrix` class seem to lose some of its attributes, apparently when the jit kicks in. (I guess this was a known bug, but I didn't see an open issue for it.) _______________________________________________ pypy-issue mailing list pypy-issue@python.org https://mail.python.org/mailman/listinfo/pypy-issue