RecursionError when looping DataMatrix
Hi,
When I do a simple loop over a DataMatrix object in OpenSesame I get: RecursionError: maximum recursion depth exceeded.
Code:
from datamatrix import DataMatrix dm = DataMatrix(length=5) dm.fibonacci = 0, 1, 1, 2, 3 for row in dm: print(row.fibonacci)
Error:
File C:\Program Files (x86)\OpenSesame\Lib\site-packages\datamatrix\_datamatrix\_row.py:78, in Row.__getattr__(self, key) 76 def __getattr__(self, key): ---> 78 return self.__getitem__(key) File C:\Program Files (x86)\OpenSesame\Lib\site-packages\datamatrix\_datamatrix\_row.py:84, in Row.__getitem__(self, key) 82 if isinstance(key, int): 83 key = self._datamatrix.column_names[key] ---> 84 return self._datamatrix[key][self._index] File C:\Program Files (x86)\OpenSesame\Lib\site-packages\datamatrix\_datamatrix\_row.py:78, in Row.__getattr__(self, key) 76 def __getattr__(self, key): ---> 78 return self.__getitem__(key) File C:\Program Files (x86)\OpenSesame\Lib\site-packages\datamatrix\_datamatrix\_row.py:84, in Row.__getitem__(self, key) 82 if isinstance(key, int): 83 key = self._datamatrix.column_names[key] ---> 84 return self._datamatrix[key][self._index] [... skipping similar frames: Row.__getattr__ at line 78 (1484 times), Row.__getitem__ at line 84 (1483 times)] File C:\Program Files (x86)\OpenSesame\Lib\site-packages\datamatrix\_datamatrix\_row.py:84, in Row.__getitem__(self, key) 82 if isinstance(key, int): 83 key = self._datamatrix.column_names[key] ---> 84 return self._datamatrix[key][self._index] File C:\Program Files (x86)\OpenSesame\Lib\site-packages\datamatrix\_datamatrix\_row.py:78, in Row.__getattr__(self, key) 76 def __getattr__(self, key): ---> 78 return self.__getitem__(key) RecursionError: maximum recursion depth exceeded
Comments
I tried it on another computer and it worked.
I think it have something to do with my installation/computer because if I use the PsychoPy back-end it crashes and looks like this:
I have tried many different version of Opensesame and it never works. But I had more success with pygames as the back-end, until I ran into this problem.