New issue 2793: cpyext class subclasses lose attributes


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)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File ".../env/site-packages/numpy/testing/nose_tools/", line 1396, in 
    verbose=verbose, header=header, equal_nan=equal_nan)
  File ".../env/site-packages/numpy/testing/nose_tools/", line 769, in 
    reduced = val.ravel()
  File ".../env/site-packages/numpy/matrixlib/", line 1020, in ravel
    return N.ndarray.ravel(self, order=order)
  File ".../env/site-packages/numpy/matrixlib/", line 260, in 
    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

Reply via email to